OSDN Git Service

Added hb_init_express - makes the binary smaller. Still need to strip
[handbrake-jp/handbrake-jp-git.git] / libhb / hb.h
1 /* $Id: hb.h,v 1.12 2005/03/29 09:40:28 titer Exp $
2
3    This file is part of the HandBrake source code.
4    Homepage: <http://handbrake.m0k.org/>.
5    It may be used under the terms of the GNU General Public License. */
6
7 #ifndef HB_HB_H
8 #define HB_HB_H
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 #include "common.h"
15
16 /* hb_init()
17    Initializes a libhb session (launches his own thread, detects CPUs,
18    etc) */
19 #define HB_DEBUG_NONE 0
20 #define HB_DEBUG_ALL  1
21 void          hb_register( hb_work_object_t * );
22 hb_handle_t * hb_init_real( int verbose, int update_check );
23
24 #define hb_init(v,u) \
25 hb_init_real( v, u ); \
26 hb_register( &hb_sync ); \
27 hb_register( &hb_decmpeg2 ); \
28 hb_register( &hb_decsub ); \
29 hb_register( &hb_render ); \
30 hb_register( &hb_encavcodec ); \
31 hb_register( &hb_encxvid ); \
32 hb_register( &hb_encx264 ); \
33 hb_register( &hb_deca52 ); \
34 hb_register( &hb_decavcodec ); \
35 hb_register( &hb_declpcm ); \
36 hb_register( &hb_encfaac ); \
37 hb_register( &hb_enclame ); \
38 hb_register( &hb_encvorbis ); \
39
40 #define hb_init_express(v,u) \
41 hb_init_real( v, u ); \
42 hb_register( &hb_sync ); \
43 hb_register( &hb_decmpeg2 ); \
44 hb_register( &hb_decsub ); \
45 hb_register( &hb_render ); \
46 hb_register( &hb_encavcodec ); \
47 hb_register( &hb_encx264 ); \
48 hb_register( &hb_deca52 ); \
49 hb_register( &hb_decavcodec ); \
50 hb_register( &hb_declpcm ); \
51 hb_register( &hb_encfaac ); \
52
53 /* hb_get_version() */
54 char        * hb_get_version( hb_handle_t * );
55 int           hb_get_build( hb_handle_t * );
56
57 /* hb_check_update()
58    Checks for an update on the website. If there is, returns the build
59    number and points 'version' to a version description. Returns a
60    negative value otherwise. */
61 int           hb_check_update( hb_handle_t * h, char ** version );
62
63 /* hb_set_cpu_count()
64    Force libhb to act as if you had X CPU(s).
65    Default is to use the detected count (see also hb_get_cpu_count() in
66    ports.h) */
67 void          hb_set_cpu_count( hb_handle_t *, int );
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 void          hb_get_preview( hb_handle_t *, hb_title_t *, int,
80                               uint8_t * );
81
82 /* Handling jobs */
83 int           hb_count( hb_handle_t * );
84 hb_job_t *    hb_job( hb_handle_t *, int );
85 void          hb_add( hb_handle_t *, hb_job_t * );
86 void          hb_rem( hb_handle_t *, hb_job_t * );
87
88 void          hb_start( hb_handle_t * );
89 void          hb_pause( hb_handle_t * );
90 void          hb_resume( hb_handle_t * );
91 void          hb_stop( hb_handle_t * );
92
93 /* hb_get_state()
94    Should be regularly called by the UI (like 5 or 10 times a second).
95    Look at test/test.c to see how to use it. */
96 void hb_get_state( hb_handle_t *, hb_state_t * );
97
98 /* hb_close()
99    Aborts all current jobs if any, frees memory. */
100 void          hb_close( hb_handle_t ** );
101
102 #ifdef __cplusplus
103 }
104 #endif
105
106 #endif