summaryrefslogtreecommitdiffstats
path: root/libhb/hb.h
blob: 3cf308e3a50252a715242bd27e381aa8b269d48f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#ifndef HB_HB_H
#define HB_HB_H

#ifdef __cplusplus
extern "C" {
#endif

#include "project.h"
#include "common.h"

/* hb_init()
   Initializes a libhb session (launches his own thread, detects CPUs,
   etc) */
#define HB_DEBUG_NONE 0
#define HB_DEBUG_ALL  1
void          hb_register( hb_work_object_t * );
hb_handle_t * hb_init_real( int verbose, int update_check );
hb_handle_t * hb_init_dl ( int verbose, int update_check ); // hb_init for use with dylib

#define hb_init(v,u) \
hb_init_real( v, u ); \
hb_register( &hb_sync ); \
hb_register( &hb_decmpeg2 ); \
hb_register( &hb_decvobsub ); \
hb_register( &hb_encvobsub ); \
hb_register( &hb_deccc608 ); \
hb_register( &hb_render ); \
hb_register( &hb_encavcodec ); \
hb_register( &hb_encxvid ); \
hb_register( &hb_encx264 ); \
hb_register( &hb_enctheora ); \
hb_register( &hb_deca52 ); \
hb_register( &hb_decdca ); \
hb_register( &hb_decavcodec ); \
hb_register( &hb_decavcodecv ); \
hb_register( &hb_decavcodecvi ); \
hb_register( &hb_decavcodecai ); \
hb_register( &hb_declpcm ); \
hb_register( &hb_encfaac ); \
hb_register( &hb_enclame ); \
hb_register( &hb_encvorbis ); \

#define hb_init_express(v,u) \
hb_init_real( v, u ); \
hb_register( &hb_sync ); \
hb_register( &hb_decmpeg2 ); \
hb_register( &hb_decvobsub ); \
hb_register( &hb_encvobsub ); \
hb_register( &hb_deccc608 ); \
hb_register( &hb_render ); \
hb_register( &hb_encavcodec ); \
hb_register( &hb_encx264 ); \
hb_register( &hb_deca52 ); \
hb_register( &hb_decdca ); \
hb_register( &hb_decavcodec ); \
hb_register( &hb_decavcodecv ); \
hb_register( &hb_decavcodecvi ); \
hb_register( &hb_decavcodecai ); \
hb_register( &hb_declpcm ); \
hb_register( &hb_encfaac ); \

/* hb_get_version() */
char        * hb_get_version( hb_handle_t * );
int           hb_get_build( hb_handle_t * );

/* hb_check_update()
   Checks for an update on the website. If there is, returns the build
   number and points 'version' to a version description. Returns a
   negative value otherwise. */
int           hb_check_update( hb_handle_t * h, char ** version );

/* hb_set_cpu_count()
   Force libhb to act as if you had X CPU(s).
   Default is to use the detected count (see also hb_get_cpu_count() in
   ports.h) */
void          hb_set_cpu_count( hb_handle_t *, int );

char *        hb_dvd_name( char * path );
void          hb_dvd_set_dvdnav( int enable );

/* hb_scan()
   Scan the specified path. Can be a DVD device, a VIDEO_TS folder or
   a VOB file. If title_index is 0, scan all titles. */
void          hb_scan( hb_handle_t *, const char * path,
                       int title_index, int preview_count,
                       int store_previews );

/* hb_get_titles()
   Returns the list of valid titles detected by the latest scan. */
hb_list_t   * hb_get_titles( hb_handle_t * );

/* hb_detect_comb()
   Analyze a frame for interlacing artifacts, returns true if they're found.
   Taken from Thomas Oestreich's 32detect filter in the Transcode project.  */
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 );

void          hb_get_preview( hb_handle_t *, hb_title_t *, int,
                              uint8_t * );
void          hb_set_size( hb_job_t *, double ratio, int pixels );
void          hb_set_anamorphic_size( hb_job_t *,
                int *output_width, int *output_height,
                int *output_par_width, int *output_par_height);

/* Handling jobs */
int           hb_count( hb_handle_t * );
hb_job_t *    hb_job( hb_handle_t *, int );
void          hb_add( hb_handle_t *, hb_job_t * );
void          hb_rem( hb_handle_t *, hb_job_t * );

void          hb_start( hb_handle_t * );
void          hb_pause( hb_handle_t * );
void          hb_resume( hb_handle_t * );
void          hb_stop( hb_handle_t * );

/* hb_get_state()
   Should be regularly called by the UI (like 5 or 10 times a second).
   Look at test/test.c to see how to use it. */
void hb_get_state( hb_handle_t *, hb_state_t * );
void hb_get_state2( hb_handle_t *, hb_state_t * );
/* hb_get_scancount() is called by the MacGui in UpdateUI to
   check for a new scan during HB_STATE_WORKING phase  */
int hb_get_scancount( hb_handle_t * );

/* hb_close()
   Aborts all current jobs if any, frees memory. */
void          hb_close( hb_handle_t ** );

#ifdef __cplusplus
}
#endif

#endif