OSDN Git Service

MacGui: preview changes to coincide with rev 2376
[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 void          hb_dvd_set_dvdnav( int enable );
76
77 /* hb_scan()
78    Scan the specified path. Can be a DVD device, a VIDEO_TS folder or
79    a VOB file. If title_index is 0, scan all titles. */
80 void          hb_scan( hb_handle_t *, const char * path,
81                        int title_index, int preview_count,
82                        int store_previews );
83
84 /* hb_get_titles()
85    Returns the list of valid titles detected by the latest scan. */
86 hb_list_t   * hb_get_titles( hb_handle_t * );
87
88 /* hb_detect_comb()
89    Analyze a frame for interlacing artifacts, returns true if they're found.
90    Taken from Thomas Oestreich's 32detect filter in the Transcode project.  */
91 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 );
92
93 void          hb_get_preview( hb_handle_t *, hb_title_t *, int,
94                               uint8_t * );
95 void          hb_set_size( hb_job_t *, double ratio, int pixels );
96 void          hb_set_anamorphic_size( hb_job_t *,
97                 int *output_width, int *output_height,
98                 int *output_par_width, int *output_par_height);
99
100 /* Handling jobs */
101 int           hb_count( hb_handle_t * );
102 hb_job_t *    hb_job( hb_handle_t *, int );
103 void          hb_add( hb_handle_t *, hb_job_t * );
104 void          hb_rem( hb_handle_t *, hb_job_t * );
105
106 void          hb_start( hb_handle_t * );
107 void          hb_pause( hb_handle_t * );
108 void          hb_resume( hb_handle_t * );
109 void          hb_stop( hb_handle_t * );
110
111 /* hb_get_state()
112    Should be regularly called by the UI (like 5 or 10 times a second).
113    Look at test/test.c to see how to use it. */
114 void hb_get_state( hb_handle_t *, hb_state_t * );
115 void hb_get_state2( hb_handle_t *, hb_state_t * );
116 /* hb_get_scancount() is called by the MacGui in UpdateUI to
117    check for a new scan during HB_STATE_WORKING phase  */
118 int hb_get_scancount( hb_handle_t * );
119
120 /* hb_close()
121    Aborts all current jobs if any, frees memory. */
122 void          hb_close( hb_handle_t ** );
123
124 #ifdef __cplusplus
125 }
126 #endif
127
128 #endif