OSDN Git Service

e04fcd4fa497760af2d7dcd1a9dd85fd6b099395
[handbrake-jp/handbrake-jp-git.git] / libhb / encvobsub.c
1 /* $Id: envvobsub.c
2
3    This file is part of the HandBrake source code.
4    Homepage: <http://handbrake.fr/>.
5    It may be used under the terms of the GNU General Public License. */
6
7 #include "hb.h"
8
9 struct hb_work_private_s
10 {
11     hb_job_t * job;
12 };
13
14 int encsubInit( hb_work_object_t * w, hb_job_t * job )
15 {
16     hb_work_private_t * pv;
17
18     pv              = calloc( 1, sizeof( hb_work_private_t ) );
19     w->private_data = pv;
20
21     pv->job = job;
22
23     return 0;
24 }
25
26 int encsubWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
27                 hb_buffer_t ** buf_out )
28 {
29     hb_work_private_t * pv = w->private_data;
30     hb_buffer_t * in = *buf_in;
31
32     if ( in->size <= 0 )
33     {
34         /* EOF on input stream - send it downstream & say that we're done */
35         *buf_out = in;
36         *buf_in = NULL;
37         return HB_WORK_DONE;
38     }
39
40     /*
41      * Don't do anything at present, just pass the buffer on.
42      */
43     *buf_out = in;
44     *buf_in = NULL;
45
46     return HB_WORK_OK; 
47 }
48
49 void encsubClose( hb_work_object_t * w )
50 {
51     free( w->private_data );
52 }
53
54 hb_work_object_t hb_encsub =
55 {
56     WORK_ENCSUB,
57     "VOBSUB encoder",
58     encsubInit,
59     encsubWork,
60     encsubClose
61 };