<div dir="ltr"><br><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div><div><span style="color:rgb(7,55,99)"><font><span style="font-family:arial,helvetica,sans-serif"><span></span><a></a><span></span>Greeshma </span></font></span></div></div></div><div><span style="font-family:'courier new',monospace"><br></span></div></div></div></div>
<br><div class="gmail_quote">On Tue, Mar 24, 2015 at 10:06 PM, Francois Cartegnie <span dir="ltr"><<a href="mailto:fcvlcdev@free.fr" target="_blank">fcvlcdev@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Le 24/03/2015 15:36, Devin Heitmueller a écrit :<br>
<span class="">> - I believe we're currently only feeding the EIA-608 bytes to the cc<br>
> decoder currently. If we wanted to support EIA-708, the MPEG2 demux<br>
> would need to be modified to create additional decoder instances and<br>
> feed those bytes instead.<br>
<br>
</span>Since that's embedded in the MPEG2 stream, that's instanciated by the ES<br>
when mpegvideo decoders/packetizers are providing p_dec->pf_get_cc.<br>
That one returning extracted/collected data from the mpeg2 user data.<br>
Demuxer itself has no knowledge of CC (as opposed to the mp4 demux).<br>
<br>
The CC decoder, instanciated from an arbitrary, by channel, fourcc, then<br>
also gather and decodes.<br>
<br>
For 708 support, we need to be able to pass more parameters, either<br>
through get_cc or additional call.<br>
<br>
We also need to collect DTV cc stream at packetizer & mpeg decoder level.<br>
Currently, cc_types > 2 are skipped. DTV being 3.<br>
<span class=""><br>
> EIA-608 (or the reverse) if both are present? Do we have some global<br>
> configuration option which dictates which decoder gets used?<br>
<br>
</span>none<br>
<span class=""><br>
> - Adding support for some of these features could exacerbate known<br>
> performance issues in the existing SPU renderer. There are some<br>
> assumptions made with regards to things such as font size and<br>
> positioning which could cause a significant reduction in compositing<br>
> performance if we provide more flexibility as allowed by EIA-708. I<br>
> can get into more specifics on this in a separate email.<br>
<br>
</span>We're already doing this for MP4/tx3g, except positioning. <br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><font color="#888888">
Francois<br>
</font></span><div class=""><div class="h5"><br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a></div></div></blockquote><div><br></div><div><br></div><div>Hello,</div><div><br></div><div>The caption commands are added and few functions are handled accordingly. Still working on the functions which needs window bitmap.</div><div><br></div><div><div>From 002db1dde968a73fbcfeda25b2cbf97d3ca6379b Mon Sep 17 00:00:00 2001</div><div>From: greeshmab <<a href="mailto:greeshmabalabadra@gmail.com">greeshmabalabadra@gmail.com</a>></div><div>Date: Thu, 26 Mar 2015 20:48:00 +0530</div><div>Subject: [PATCH] Caption commands added and functions handled</div><div><br></div><div>---</div><div> modules/codec/cc.c | 166 +++++++++++++++++++++++++++++++++++++++++++++++++++--</div><div> modules/codec/cc.h | 8 +++</div><div> 2 files changed, 170 insertions(+), 4 deletions(-)</div><div><br></div><div>diff --git a/modules/codec/cc.c b/modules/codec/cc.c</div><div>index 89754f6..9d5ea1f 100644</div><div>--- a/modules/codec/cc.c</div><div>+++ b/modules/codec/cc.c</div><div>@@ -1328,11 +1328,16 @@ typedef struct eia708_window</div><div> int pen_column;</div><div> } eia708_window;</div><div> </div><div>-//Couldn't figure out the structure of eia708 service packet/block.</div><div>-</div><div>-typedef struct{</div><div>- eia708_window windows[10];</div><div>+typedef struct eia708_t</div><div>+{</div><div>+ e708Window windows[10];</div><div> int current_window;</div><div>+ int inited;</div><div>+ tvscreen tv[2]; // Current and previous "screenfuls", note that we switch between them</div><div>+ int cur_tv; // 1 or 2 rather than 0 or 1, to at least be consistent with the decoder</div><div>+ tvscreen *tv; // Pointer to the current TV buffer</div><div>+ char *filename; // Where we are going to write our output</div><div>+ int fh; // Handle to output file. -1 if not yet open</div><div> }eia708_t;</div><div> </div><div> static void eia708_SetPenAttributes (eia708_t *service, uint8_t *data)</div><div>@@ -1381,4 +1386,157 @@ static void eia708_SetPenLocation (eia708_t *service, uint8_t *data)</div><div> }</div><div> </div><div> </div><div>+const char *eia708_Caption_Commands_C0[32]=</div><div>+{</div><div>+ "NUL", // 0 = NUL</div><div>+ NULL, // 1 = Reserved</div><div>+ NULL, // 2 = Reserved</div><div>+ "ETX", // 3 = ETX</div><div>+ NULL, // 4 = Reserved</div><div>+ NULL, // 5 = Reserved</div><div>+ NULL, // 6 = Reserved</div><div>+ NULL, // 7 = Reserved</div><div>+ "BS", // 8 = Backspace</div><div>+ NULL, // 9 = Reserved</div><div>+ NULL, // A = Reserved</div><div>+ NULL, // B = Reserved</div><div>+ "FF", // C = FF</div><div>+ "CR", // D = CR</div><div>+ "HCR", // E = HCR</div><div>+ NULL, // F = Reserved</div><div>+ "EXT1",// 0x10 = EXT1,</div><div>+ NULL, // 0x11 = Reserved</div><div>+ NULL, // 0x12 = Reserved</div><div>+ NULL, // 0x13 = Reserved</div><div>+ NULL, // 0x14 = Reserved</div><div>+ NULL, // 0x15 = Reserved</div><div>+ NULL, // 0x16 = Reserved</div><div>+ NULL, // 0x17 = Reserved</div><div>+ "P16", // 0x18 = P16</div><div>+ NULL, // 0x19 = Reserved</div><div>+ NULL, // 0x1A = Reserved</div><div>+ NULL, // 0x1B = Reserved</div><div>+ NULL, // 0x1C = Reserved</div><div>+ NULL, // 0x1D = Reserved</div><div>+ NULL, // 0x1E = Reserved</div><div>+ NULL, // 0x1F = Reserved</div><div>+};</div><div>+</div><div>+struct eia708_Caption_Commands eia708_C1[28]=</div><div>+{</div><div>+ {CW0,"CW0","SetCurrentWindow0", 1},</div><div>+ {CW1,"CW1","SetCurrentWindow1", 1},</div><div>+ {CW2,"CW2","SetCurrentWindow2", 1},</div><div>+ {CW3,"CW3","SetCurrentWindow3", 1},</div><div>+ {CW4,"CW4","SetCurrentWindow4", 1},</div><div>+ {CW5,"CW5","SetCurrentWindow5", 1},</div><div>+ {CW6,"CW6","SetCurrentWindow6", 1},</div><div>+ {CW7,"CW7","SetCurrentWindow7", 1},</div><div>+ {CLW,"CLW","ClearWindows", 2},</div><div>+ {DSW,"DSW","DisplayWindows", 2},</div><div>+ {HDW,"HDW","HideWindows", 2},</div><div>+ {TGW,"TGW","ToggleWindows", 2},</div><div>+ {DLW,"DLW","DeleteWindows", 2},</div><div>+ {DLY,"DLY","Delay", 2},</div><div>+ {DLC,"DLC","DelayCancel", 1},</div><div>+ {RST,"RST","Reset", 1},</div><div>+ {SPA,"SPA","SetPenAttributes", 3},</div><div>+ {SPC,"SPC","SetPenColor", 4},</div><div>+ {SPL,"SPL","SetPenLocation", 3},</div><div>+ {SWA,"SWA","SetWindowAttributes", 5},</div><div>+ {DF0,"DF0","DefineWindow0", 7},</div><div>+ {DF1,"DF0","DefineWindow1", 7},</div><div>+ {DF2,"DF0","DefineWindow2", 7},</div><div>+ {DF3,"DF0","DefineWindow3", 7},</div><div>+ {DF4,"DF0","DefineWindow4", 7},</div><div>+ {DF5,"DF0","DefineWindow5", 7},</div><div>+ {DF6,"DF0","DefineWindow6", 7},</div><div>+ {DF7,"DF0","DefineWindow7", 7}</div><div>+};</div><div>+</div><div>+void eia708_CW_func_SetCurrentWindow (eia708_t *decoder, int new_window)</div><div>+{</div><div>+ if (decoder->windows[new_window].is_defined)</div><div>+ decoder->current_window=new_window;</div><div>+}</div><div>+</div><div>+void eia708_service_reset(eia708_t *decoder)</div><div>+{</div><div>+ for (int j=0;j<10;j++)</div><div>+ {</div><div>+ decoder->windows[j].is_defined=0;</div><div>+ decoder->windows[j].visible=0;</div><div>+ decoder->windows[j].is_empty=1;</div><div>+ memset (decoder->windows[j].commands, 0, sizeof (decoder->windows[j].commands));</div><div>+ }</div><div>+ decoder->current_window=-1;</div><div>+ //Handle TV Screen</div><div>+ decoder->inited=1;</div><div>+}</div><div> </div><div>+void eia708_SWA_func_SetWindowAttributes (eia708_t *decoder, uint8_t *data)</div><div>+{</div><div>+ if (decoder->current_window==-1)</div><div>+ return;</div><div>+ decoder->windows[decoder->current_window].attribs.fill_color=(data[1] ) & 0x3f;</div><div>+ decoder->windows[decoder->current_window].attribs.fill_opacity=(data[1]>>6) & 0x03;</div><div>+ decoder->windows[decoder->current_window].attribs.border_color=(data[2] ) & 0x3f;</div><div>+ decoder->windows[decoder->current_window].attribs.border_type01=(data[2]>>6) & 0x03;</div><div>+ decoder->windows[decoder->current_window].attribs.justify=(data[3] ) & 0x03;</div><div>+ decoder->windows[decoder->current_window].attribs.scroll_dir=(data[3]>>2) & 0x03;</div><div>+ decoder->windows[decoder->current_window].attribs.print_dir=(data[3]>>4) & 0x03;</div><div>+ decoder->windows[decoder->current_window].attribs.word_wrap=(data[3]>>6) & 0x01;</div><div>+ decoder->windows[decoder->current_window].attribs.border_type=(data[3]>>5) | border_type01;</div><div>+ decoder->windows[decoder->current_window].attribs.display_eff=(data[4] ) & 0x03;</div><div>+ decoder->windows[decoder->current_window].attribs.effect_dir=(data[4]>>2) & 0x03;</div><div>+ decoder->windows[decoder->current_window].attribs.effect_speed=(data[4]>>4) & 0x0f;</div><div>+}</div><div>+</div><div>+// Captioning Commands Control Codes C1</div><div>+int eia708_Caption_C1_funcs (eia708_t *decoder, uint8_t *data, int data_length)</div><div>+{</div><div>+ struct eia708_Caption_Commands tempCom=eia708_C1[data[0]-0x80];</div><div>+</div><div>+ switch (com.code)</div><div>+ {</div><div>+ case CW0: /* SetCurrentWindow */</div><div>+ case CW1:</div><div>+ case CW2:</div><div>+ case CW3:</div><div>+ case CW4:</div><div>+ case CW5:</div><div>+ case CW6:</div><div>+ case CW7:</div><div>+ eia708_CW_func_SetCurrentWindow (decoder, tempCom.code-CW0); /* Window 0 to 7 */</div><div>+ break;</div><div>+ /*</div><div>+ other cases i.e CLW,DSW,HDW,DLW,DLY,DLC,TGW deals with windows bitmap,still working on it</div><div>+ */</div><div>+ case RST:</div><div>+ eia708_service_reset(decoder);</div><div>+ break;</div><div>+ case SPA:</div><div>+ eia708_SetPenAttributes (decoder, data);</div><div>+ break;</div><div>+ case SPC:</div><div>+ eia708_SetPenColor (decoder, data);</div><div>+ break;</div><div>+ case SPL:</div><div>+ heia708_SetPenLocation (decoder, data);</div><div>+ break;</div><div>+ case SWA:</div><div>+ eia708_SWA_func_SetWindowAttributes (decoder, data);</div><div>+ break;</div><div>+ case DF0:</div><div>+ case DF1:</div><div>+ case DF2:</div><div>+ case DF3:</div><div>+ case DF4:</div><div>+ case DF5:</div><div>+ case DF6:</div><div>+ case DF7:</div><div>+ //Define window</div><div>+ break;</div><div>+ }</div><div>+ return com.length;</div><div>+}</div><div>diff --git a/modules/codec/cc.h b/modules/codec/cc.h</div><div>index e824780..de2ddfc 100644</div><div>--- a/modules/codec/cc.h</div><div>+++ b/modules/codec/cc.h</div><div>@@ -279,5 +279,13 @@ static inline void cc_Extract( cc_data_t *c, bool b_top_field_first, const uint8</div><div> }</div><div> }</div><div> </div><div>+struct eia708_Caption_Commands</div><div>+{</div><div>+ int code;</div><div>+ const char *name;</div><div>+ const char *description;</div><div>+ int length;</div><div>+};</div><div>+</div><div> #endif /* _CC_H */</div><div> </div><div>-- </div><div>2.1.4</div></div><div><br></div></div><br></div></div>