[vlc-devel] [vlc-commits] Add NTSC EIA-608 caption rendering support via V4L2 VBI devices
Rafaël Carré
funman at videolan.org
Thu Dec 13 11:28:33 CET 2012
Hello,
Le 10/12/2012 17:11, Devin Heitmueller a écrit :
> vlc | branch: master | Devin Heitmueller <dheitmueller at kernellabs.com> | Mon Dec 10 11:02:07 2012 -0500| [bf4eb0941758ec544c6e4911414bdfdf263a3ea6] | committer: Rémi Denis-Courmont
>
> Add NTSC EIA-608 caption rendering support via V4L2 VBI devices
>
> This patch introduces support for using V4L2 VBI devices for
> reading NTSC EIA-608 closed captions.
>
> This patch includes feedback from the vlc-devel mailing list from
> the Oct 21, 2012, Oct 28, 2012, and Nov 18, 2012 submission attempts.
>
> Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
>
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bf4eb0941758ec544c6e4911414bdfdf263a3ea6
> ---
>
> modules/access/Modules.am | 5 +-
> modules/access/v4l2/access.c | 3 +-
> modules/access/v4l2/demux.c | 194 ++++++++++++++++++++++++++++++++----------
> modules/access/v4l2/v4l2.c | 8 ++
> modules/access/v4l2/v4l2.h | 14 ++-
> modules/access/v4l2/vbi.c | 131 ++++++++++++++++++++++++++++
> modules/access/v4l2/video.c | 21 +++--
> 7 files changed, 320 insertions(+), 56 deletions(-)
+ for (int i = 0; i < VBI_NUM_CC_STREAMS; i++)
+ {
+ es_format_t fmt;
+
+ es_format_Init( &fmt, SPU_ES, VLC_FOURCC('c', 'c', '1' + i, ' ') );
+ if (asprintf(&fmt.psz_description, "Closed captions %d", i + 1)
>= 0)
+ {
+ msg_Dbg( demux, "new spu es %4.4s", (char*)&fmt.i_codec );
+ sys->p_es_subt[i] = es_out_Add( demux->out, &fmt );
+ }
+ }
You declare 4 streams,
+ {
+ for (int i = 0; i < num_streams; i++)
+ {
+ block_t *p_sblock;
+ if (p_es_subt[i] == NULL)
+ continue;
+ p_sblock = block_Duplicate(p_block);
+ if (p_sblock)
+ es_out_Send(p_demux->out, p_es_subt[i], p_sblock);
+ }
+ block_Release(p_block);
num_streams = VBI_NUM_CC_STREAMS = 4
But you will just duplicate the same information 4 times.
Why duplicating at all?
More information about the vlc-devel
mailing list