OSDN Git Service

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