?? readme
字號:
------------------------------------------------------------ RMSCC README------------------------------------------------------------0) Introduction---------------The rmscc (RealMagic Software Closed Captions Decoder) allows todecode a closed caption stream and display it on an OSD. This givesEM86XX systems the capacity to support closed captions with no need torely on the TV set features.The currently supported closed caption formats are: * eia608 (as described on document EIA/CEA-608-B) * eia708 (as described on document EIA-708-B)1) Opening the library----------------------Before being able to decode any data, you need to open an instance ofrmscc. This asks the library to allocate and initialize its internalstructures.The RMSCCOpen function takes a struct rmscc_init variable as its soleargument. These are the fields you need to fill:--> RMrtk rtk : Handle to an rtk instance. RMscc will use the osdbuffer associated with this rtk handle to draw the closed captions. rmscc supports rtk's double-buffering features, so it is advised thatyou open rtk with a double osd buffer. If allocating a double bufferis too expensive in your setup and you provide a single buffer, thelibrary will function normally but you might expect to see sometearing when the captions change.Other than that, a good choice for the osd buffer size would be about720x420x32bpp.-->enum rmscc_format format: The format of the data you will pass tothe library.-->RMResizeWindow resize_callback: Typically, closed captions occupyonly a relatively small region of the screen. This means that the osdbuffer contains mostly transparent pixels. Thus, it is veryinefficient, in terms of memory bandwidth consumption, to read allthose transparent pixels every time the osd is refreshed. RMscc keepstrack of where the non-transparent pixels are, and, whenever thatregion changes, it lets your application know by calling the functionpointed by resize_callback. Your application can then take theappropriate actions to save some memory bandwidth. Typically, reducethe input window from the scaler displaying the OSD, or thatcompletely disable it when all the pixels are transparent. You can pass a NULL value in here if you don't want to implement sucha function this. -->void *resize_context: This pointer is kept by the library andpassed to the resize_callback function. Can be NULL.2) Feeding the data-------------------The closed caption data comes typically on the userdata section of avideo stream. The rmscc cannot extract that data by itself: it is upto the application to provide the elementary closed captionsstream. Most common encapsulation formats for closed caption insidethe video stream are supported by EM86XX's VideoDecoder module. Inmost cases, then, connecting a CCFifo to the VideoDecoder is all ittakes to extract the data. See the CCFifo module section on theEMhwlib manual, and the ccfifo_tutorial.pdf document for more info onthis subject. If you intend to extract closed caption data that hasbeen multiplexed in a more exotic way, it is up to the application toextract it from the multimedia stream.The process of feeding the data is slightly different depending on theformat you are decoding:-->EIA608The RMSCCDecode() function takes buffers of eia608 data of anarbitrary size. The only constraint on the input buffers, is that thepacking of the eia608 data in groups of two bytes must be respected,i.e., the first byte on a buffer should always be a pair's first byte,and the last byte on a buffer should aways be a pair's second byte.IMPORTANT NOTE: Besides closed caption, other data, such as XDS,can be encapsulated on the VBI information contained by the userdatablocks. This information is not understood by rmscc and needs to befiltered out by the application. That is often achieved by keepingonly the information marked as first (top) field.-->EIA708When decoding eia708 data, a call RMSCCDecode() implies that a wholePacket (128 bytes) is being passed. The Packet should of course beginin the beginning of the buffer.3)Closing the library---------------------Don't forget to call RMSCCClose() once you're done with an rmscc instance. Annex A: Code example---------------------This example shows a simple approach to feeding two rmsccinstances. cc_rmscc has been opened to handle eia608 data, and dtv_sccto handle eia708 data.{ static RMuint8 ccbuf[128], dtvbuf[128]; static RMuint32 dtvsize, ccsize; struct CCFifo_CCEntry_type cc_entry; while((RUAGetProperty(pRUA, ccfifo_id, RMCCFifoPropertyID_CCEntry, &cc_entry, sizeof(cc_entry))) == RM_OK){ if(cc_entry.Enable){ switch(cc_entry.Type){ case EMhwlibCCType_TopField: if(ccsize >= 128 - 2){ RMSCCDecode(cc_scc, ccbuf, ccsize); ccsize = 0; } ccbuf[ccsize++] = cc_entry.CC1; ccbuf[ccsize++] = cc_entry.CC2; break; case EMhwlibCCType_DTVCCHeader: if(dtvsize){ RMSCCDecode(dtv_scc, dtvbuf, dtvsize); dtvsize = 0; } case EMhwlibCCType_DTVCCData: dtvbuf[dtvsize++] = cc_entry.CC1; dtvbuf[dtvsize++] = cc_entry.CC2; break; default: break; } } } if(ccsize){ RMSCCDecode(cc_scc, ccbuf, ccsize); ccsize = 0; }} Annex B: TODO list-------------------* Support indexed modes.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -