OSDN Git Service

Another minor step on the way back to Solaris compiles - not linking as yet.
[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 "project.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, int preview_count,
81                        int store_previews );
82
83 /* hb_get_titles()
84    Returns the list of valid titles detected by the latest scan. */
85 hb_list_t   * hb_get_titles( hb_handle_t * );
86
87 /* hb_detect_comb()
88    Analyze a frame for interlacing artifacts, returns true if they're found.
89    Taken from Thomas Oestreich's 32detect filter in the Transcode project.  */
90 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 );
91
92 void          hb_get_preview( hb_handle_t *, hb_title_t *, int,
93                               uint8_t * );
94 void          hb_set_size( hb_job_t *, double ratio, int pixels );
95 void          hb_set_anamorphic_size( hb_job_t *,
96                 int *output_width, int *output_height,
97                 int *output_par_width, int *output_par_height);
98
99 /* Handling jobs */
100 int           hb_count( hb_handle_t * );
101 hb_job_t *    hb_job( hb_handle_t *, int );
102 void          hb_add( hb_handle_t *, hb_job_t * );
103 void          hb_rem( hb_handle_t *, hb_job_t * );
104
105 void          hb_start( hb_handle_t * );
106 void          hb_pause( hb_handle_t * );
107 void          hb_resume( hb_handle_t * );
108 void          hb_stop( hb_handle_t * );
109
110 /* hb_get_state()
111    Should be regularly called by the UI (like 5 or 10 times a second).
112    Look at test/test.c to see how to use it. */
113 void hb_get_state( hb_handle_t *, hb_state_t * );
114 void hb_get_state2( hb_handle_t *, hb_state_t * );
115 /* hb_get_scancount() is called by the MacGui in UpdateUI to
116    check for a new scan during HB_STATE_WORKING phase  */
117 int hb_get_scancount( hb_handle_t * );
118
119 /* hb_close()
120    Aborts all current jobs if any, frees memory. */
121 void          hb_close( hb_handle_t ** );
122
123 #ifdef __cplusplus
124 }
125 #endif
126
127 #endif