3 Copyright (c) 2003-2015 HandBrake Team
4 This file is part of the HandBrake source code
5 Homepage: <http://handbrake.fr/>.
6 It may be used under the terms of the GNU General Public License v2.
7 For full terms see the file COPYING file or visit http://www.gnu.org/licenses/gpl-2.0.html
27 Initializes a libhb session (launches his own thread, detects CPUs,
29 #define HB_DEBUG_NONE 0
30 #define HB_DEBUG_ALL 1
31 void hb_register( hb_work_object_t
* );
32 void hb_register_logger( void (*log_cb
)(const char* message
) );
33 hb_handle_t
* hb_init( int verbose
, int update_check
);
34 void hb_update_poll(hb_handle_t
*h
);
35 void hb_log_level_set(hb_handle_t
*h
, int level
);
37 void hb_hwd_set_enable( hb_handle_t
*h
, uint8_t enable
);
38 int hb_hwd_enabled( hb_handle_t
*h
);
39 hb_hwd_t
* hb_hwd_get_context();
41 /* hb_get_version() */
42 char * hb_get_version( hb_handle_t
* );
43 int hb_get_build( hb_handle_t
* );
46 Checks for an update on the website. If there is, returns the build
47 number and points 'version' to a version description. Returns a
48 negative value otherwise. */
49 int hb_check_update( hb_handle_t
* h
, char ** version
);
52 char * hb_dvd_name( char * path
);
53 void hb_dvd_set_dvdnav( int enable
);
56 Scan the specified path. Can be a DVD device, a VIDEO_TS folder or
57 a VOB file. If title_index is 0, scan all titles. */
58 void hb_scan( hb_handle_t
*, const char * path
,
59 int title_index
, int preview_count
,
60 int store_previews
, uint64_t min_duration
);
61 void hb_scan_stop( hb_handle_t
* );
62 uint64_t hb_first_duration( hb_handle_t
* );
65 Returns the list of valid titles detected by the latest scan. */
66 hb_list_t
* hb_get_titles( hb_handle_t
* );
69 Returns the title set which contains a list of valid titles detected
70 by the latest scan and title set data. */
71 hb_title_set_t
* hb_get_title_set( hb_handle_t
* );
74 Analyze a frame for interlacing artifacts, returns true if they're found.
75 Taken from Thomas Oestreich's 32detect filter in the Transcode project. */
76 int hb_detect_comb( hb_buffer_t
* buf
, int color_equal
, int color_diff
, int threshold
, int prog_equal
, int prog_diff
, int prog_threshold
);
79 int hb_save_preview( hb_handle_t
* h
, int title
, int preview
,
81 hb_buffer_t
* hb_read_preview( hb_handle_t
* h
, hb_title_t
*title
,
83 hb_image_t
* hb_get_preview2(hb_handle_t
* h
, int title_idx
, int picture
,
84 hb_geometry_settings_t
*geo
, int deinterlace
);
85 void hb_set_anamorphic_size2(hb_geometry_t
*src_geo
,
86 hb_geometry_settings_t
*geo
,
87 hb_geometry_t
*result
);
88 void hb_add_filter( hb_job_t
* job
, hb_filter_object_t
* filter
,
89 const char * settings
);
92 int hb_count( hb_handle_t
* );
93 hb_job_t
* hb_job( hb_handle_t
*, int );
94 void hb_add( hb_handle_t
*, hb_job_t
* );
95 void hb_rem( hb_handle_t
*, hb_job_t
* );
97 hb_title_t
* hb_find_title_by_index( hb_handle_t
*h
, int title_index
);
98 hb_job_t
* hb_job_init_by_index( hb_handle_t
*h
, int title_index
);
99 hb_job_t
* hb_job_init( hb_title_t
* title
);
100 void hb_job_close( hb_job_t
** job
);
102 void hb_start( hb_handle_t
* );
103 void hb_pause( hb_handle_t
* );
104 void hb_resume( hb_handle_t
* );
105 void hb_stop( hb_handle_t
* );
107 void hb_system_sleep_allow(hb_handle_t
*);
108 void hb_system_sleep_prevent(hb_handle_t
*);
110 /* Persistent data between jobs. */
111 typedef struct hb_interjob_s
113 int last_job
; /* job->sequence_id & 0xFFFFFF */
114 int frame_count
; /* number of frames counted by sync */
115 int out_frame_count
; /* number of frames counted by render */
116 uint64_t total_time
; /* real length in 90kHz ticks (i.e. seconds / 90000) */
117 hb_rational_t vrate
; /* actual measured output vrate from 1st pass */
119 hb_subtitle_t
*select_subtitle
; /* foreign language scan subtitle */
122 hb_interjob_t
* hb_interjob_get( hb_handle_t
* );
125 Should be regularly called by the UI (like 5 or 10 times a second).
126 Look at test/test.c to see how to use it. */
127 void hb_get_state( hb_handle_t
*, hb_state_t
* );
128 void hb_get_state2( hb_handle_t
*, hb_state_t
* );
131 Aborts all current jobs if any, frees memory. */
132 void hb_close( hb_handle_t
** );
135 Performs process initialization. */
136 int hb_global_init();
138 Performs final cleanup for the process. */
139 void hb_global_close();
141 /* hb_get_instance_id()
142 Return the unique instance id of an libhb instance created by hb_init. */
143 int hb_get_instance_id( hb_handle_t
* h
);