OSDN Git Service

- support blu-ray, avchd & dvb x264
[handbrake-jp/handbrake-jp-git.git] / libhb / hb.h
1 #ifndef HB_HB_H
2 #define HB_HB_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include "hbversion.h"
9 #include "common.h"
10
11 /* hb_init()
12    Initializes a libhb session (launches his own thread, detects CPUs,
13    etc) */
14 #define HB_DEBUG_NONE 0
15 #define HB_DEBUG_ALL  1
16 void          hb_register( hb_work_object_t * );
17 hb_handle_t * hb_init_real( int verbose, int update_check );
18 hb_handle_t * hb_init_dl ( int verbose, int update_check ); // hb_init for use with dylib
19
20 #define hb_init(v,u) \
21 hb_init_real( v, u ); \
22 hb_register( &hb_sync ); \
23 hb_register( &hb_decmpeg2 ); \
24 hb_register( &hb_decsub ); \
25 hb_register( &hb_render ); \
26 hb_register( &hb_encavcodec ); \
27 hb_register( &hb_encxvid ); \
28 hb_register( &hb_encx264 ); \
29 hb_register( &hb_enctheora ); \
30 hb_register( &hb_deca52 ); \
31 hb_register( &hb_decdca ); \
32 hb_register( &hb_decavcodec ); \
33 hb_register( &hb_decavcodecv ); \
34 hb_register( &hb_decavcodecvi ); \
35 hb_register( &hb_decavcodecai ); \
36 hb_register( &hb_declpcm ); \
37 hb_register( &hb_encfaac ); \
38 hb_register( &hb_enclame ); \
39 hb_register( &hb_encvorbis ); \
40
41 #define hb_init_express(v,u) \
42 hb_init_real( v, u ); \
43 hb_register( &hb_sync ); \
44 hb_register( &hb_decmpeg2 ); \
45 hb_register( &hb_decsub ); \
46 hb_register( &hb_render ); \
47 hb_register( &hb_encavcodec ); \
48 hb_register( &hb_encx264 ); \
49 hb_register( &hb_deca52 ); \
50 hb_register( &hb_decdca ); \
51 hb_register( &hb_decavcodec ); \
52 hb_register( &hb_decavcodecv ); \
53 hb_register( &hb_decavcodecvi ); \
54 hb_register( &hb_decavcodecai ); \
55 hb_register( &hb_declpcm ); \
56 hb_register( &hb_encfaac ); \
57
58 /* hb_get_version() */
59 char        * hb_get_version( hb_handle_t * );
60 int           hb_get_build( hb_handle_t * );
61
62 /* hb_check_update()
63    Checks for an update on the website. If there is, returns the build
64    number and points 'version' to a version description. Returns a
65    negative value otherwise. */
66 int           hb_check_update( hb_handle_t * h, char ** version );
67
68 /* hb_set_cpu_count()
69    Force libhb to act as if you had X CPU(s).
70    Default is to use the detected count (see also hb_get_cpu_count() in
71    ports.h) */
72 void          hb_set_cpu_count( hb_handle_t *, int );
73
74 char *        hb_dvd_name( char * path );
75
76 /* hb_scan()
77    Scan the specified path. Can be a DVD device, a VIDEO_TS folder or
78    a VOB file. If title_index is 0, scan all titles. */
79 void          hb_scan( hb_handle_t *, const char * path,
80                        int title_index );
81
82 /* hb_get_titles()
83    Returns the list of valid titles detected by the latest scan. */
84 hb_list_t   * hb_get_titles( hb_handle_t * );
85
86 /* hb_detect_comb()
87    Analyze a frame for interlacing artifacts, returns true if they're found.
88    Taken from Thomas Oestreich's 32detect filter in the Transcode project.  */
89 int hb_detect_comb( hb_buffer_t * buf, int width, int height, int color_equal, int color_diff, int threshold, int prog_equal, int prog_diff, int prog_threshold );
90
91 void          hb_get_preview( hb_handle_t *, hb_title_t *, int,
92                               uint8_t * );
93 void          hb_set_size( hb_job_t *, int ratio, int pixels );
94 void          hb_set_anamorphic_size( hb_job_t *,
95                 int *output_width, int *output_height,
96                 int *output_par_width, int *output_par_height);
97
98 /* Handling jobs */
99 int           hb_count( hb_handle_t * );
100 hb_job_t *    hb_job( hb_handle_t *, int );
101 void          hb_add( hb_handle_t *, hb_job_t * );
102 void          hb_rem( hb_handle_t *, hb_job_t * );
103
104 void          hb_start( hb_handle_t * );
105 void          hb_pause( hb_handle_t * );
106 void          hb_resume( hb_handle_t * );
107 void          hb_stop( hb_handle_t * );
108
109 /* hb_get_state()
110    Should be regularly called by the UI (like 5 or 10 times a second).
111    Look at test/test.c to see how to use it. */
112 void hb_get_state( hb_handle_t *, hb_state_t * );
113 void hb_get_state2( hb_handle_t *, hb_state_t * );
114 /* hb_get_scancount() is called by the MacGui in UpdateUI to
115    check for a new scan during HB_STATE_WORKING phase  */
116 int hb_get_scancount( hb_handle_t * );
117
118 /* hb_close()
119    Aborts all current jobs if any, frees memory. */
120 void          hb_close( hb_handle_t ** );
121
122 #ifdef __cplusplus
123 }
124 #endif
125
126 #endif