Summary of the invention
The invention provides the method for a kind of television set and broadcast Real format stream media thereof, it has overcome the technical problem that present television set can't be play the Real format stream media.
Purpose of the present invention realizes like this: a kind of method of television for play Real format stream media, this method has been used television set and has been stored the peripheral storage device of Real format stream media, have primary processor and decoding coprocessor in the television set, this method may further comprise the steps: step P1, file transfer step, system for TV set read the files in stream media of Real form in the peripheral storage device; Step P2, the decoding process step, it is audio signal and the vision signal that television set is accepted that the primary processor of television set and decoding coprocessor cooperate Real format stream media file decoding; Step P3 plays step, and audio signal and vision signal are sent into the audio output interface and the video output interface of television set hardware platform respectively, with by the hardware platform playing stream media.
Step P2 in this method, the decoding process step comprises: step P21, the document analysis step decomposites Real audio code stream packet and Real video codeword data stream bag from Real format stream media file; Step P22 unpacks step, unpacks Real audio code stream packet and obtains the audio code stream data block, unpacks Real video codeword data stream bag and obtains the video codeword data stream frame; Step P23, decoding step, decoded audio bit stream data piece is to obtain the audio signal that television set is accepted, and decoded video bit stream data frame is to obtain the vision signal that television set is accepted.
Have primary processor and decoding coprocessor in this television set, step P23 in this method, decoding step, decoding coprocessor and primary processor parallel running in the television set, be used for decoded audio bit stream data piece obtaining the audio signal that television set is accepted, and/or be used for decoded video bit stream data frame to obtain the vision signal that television set is accepted.
Step P23 in this method, decoding step comprises: step P231, obtain the decoding task step, primary processor is obtained a decoding task in order, then this decoding task is put into task queue, then execution in step P232 and step P233; Step P232, transformation task formation step, primary processor is waited for the decoding coprocessor that receives in the task queue state, the coprocessor execution in step of decoding then P234 with the task queue place of being transmitted in; Step P234 carries out the decoding task step, and the decoding coprocessor is carried out decoding task, and decoding is finished back output result and sent decoding and finish notice, gets back to the reception task queue state of waiting for then; Step P233 waits for notifying process, other affairs of master processor processes, and judge whether to receive that the decoding that coprocessor sends finishes notice, if then execution in step P235 if not, then continues to carry out this step; Step P235 reads the decoded result step, and primary processor reads the decoded result of coprocessor output, execution in step P231 then, and primary processor is obtained next decoding task in order.
This television set has USB interface and media manager, and this peripheral storage device has USB interface; Step P1 in this method, the file transfer step comprises: step P11, system detects step, and whether the television set primary processor detects has the USB peripheral storage device to insert, if, then send message to media manager, if not, then continue to carry out this step; Step P12, the notice user steps, media manager inserts the event notice user interface with the USB peripheral storage device, and user interface shows that the USB peripheral storage device inserts prompting, and waits for that the user operates playback of media files; Step P13, the user selects step, selects the Real format stream media in the peripheral storage device, and gives an order and determine to begin to play; Step P14, the file transfer step, system for TV set reads the files in stream media of Real form in the peripheral storage device by the USB transmission means.
Step P21 in this invention, the document analysis step comprises: step P211, determining step judges whether this document is the Real media file, if then execution in step P212 if not, then withdraws from and no longer carry out the operation of back; Step P212 sets up the resolver step, sets up the Real document parser, and the inner parameter of initialization resolver, and the file fetch interface function according to different operating is provided with the file fetch channel then; Step P213, read the parameter step, resolver reads the file header of media file by fetch channel, and reads the file relevant parameter from file header, read the audio stream in the media file and the head of video flowing according to these parameters then, so far document parser has been finished whole initialization; Step P214, waiting step is waited for calling of upper layer application; Step P215, the upper layer application invocation step is if call to playing, then deposit order execution in step P216 successively,, then stop document analysis and close resolver if call to stopping by the physics of file, be redirect if call, then jump to the user one time execution in step P216 then is set; Step P216, decomposition step according to the head of audio stream and video flowing, decomposites Real audio code stream packet and Real video codeword data stream bag and with its input data as step P22 from the Real media file.
Step P22 in this invention unpacks step and comprises: step P221, set up the de-packetizer step, and set up de-packetizer and initialization de-packetizer, obtain initialization de-packetizer desired data; Step P222, waiting step is waited for calling of upper layer application; Step P223, the upper layer application invocation step be to be play if call, and then execution in step P224 if call to stopping, then stopping file and unpacks and close de-packetizer, is redirect if call, and then jumps to the user one time execution in step P224 then is set; Step P224 unpacks step, receives Real audio code stream packet and Real video codeword data stream bag from step P216, and input video de-packetizer and audio frequency de-packetizer unpack the input data of back data as step P23 to unpack respectively.
Purpose of the present invention also can be achieved like this: a kind of television set, it comprises primary processor, the decoding coprocessor, interface module, memory, audio output interface and video output interface, interface module connects primary processor to be used to receive the Real format stream media of peripheral storage device storage, primary processor is connected and cooperates with to be used for Real format stream media file decoding with the decoding coprocessor is audio signal and the vision signal that television set is accepted, and audio output interface and video output interface all are connected in primary processor to be used to receive decoded audio signal and vision signal.
Have in this television set: the document analysis module is used for decompositing Real audio code stream packet and Real video codeword data stream bag from Real format stream media file; And parse module, be used to unpack Real audio code stream packet and obtain the audio code stream data block, unpack Real video codeword data stream bag and obtain the video codeword data stream frame; Primary processor and decoding coprocessor cooperate, and are used for decoded audio bit stream data piece to obtain the audio signal that television set is accepted, and decoded video bit stream data frame is to obtain the vision signal that television set is accepted.
Technical scheme of the present invention, in television set, be embedded the decoding coprocessor, and primary processor and decoding coprocessor executed in parallel are decoded, then can realize the decoding to Real format stream media file on lower hardware cost, the user is put on the TV behind the extended formatting to play again.Technical scheme of the present invention has not only solved television set as if the technical problem of decoding and will cause serious picture to postpone even stagnate according to the Real decoding process of pure software on the computer, and has solved television set if adopt the high primary frequency chip to satisfy the technical problem that the decoding efficiency requirement will cause hardware cost to improve greatly.
Embodiment
Please refer to Fig. 1, the hardware block diagram of television set of the present invention.A kind of television set comprises primary processor 1, entropy decoding association primary processor 2, DRAM internal memory 3, usb interface module 4, SD card interface module 5, nonvolatile memory 6 and audio output interface and video output interface.Usb interface module 4 and SD card interface module 5 all are connected in primary processor 1, and both all are used to receive the Real format stream media of peripheral storage device (as USB flash disk or SD card) stored.Nonvolatile memory 6 is connected to primary processor 1 and is used to preserve user's setting and reads user's setting after system start-up loads.What entropy decoding association primary processor 2 adopted in the present embodiment is the CC1100 chip of using C2MicroSystem company.Operating file parsing module and parse module on the primary processor 1; The document analysis module is used for decompositing Real audio code stream packet and Real video codeword data stream bag from Real format stream media file; Parse module is divided into audio frequency parse module and video parse module, and the audio frequency parse module receives and unpacks Real audio code stream packet and obtains the audio code stream data block, and the video parse module receives and unpacks Real video codeword data stream bag and obtains the video codeword data stream frame.Entropy decoding association primary processor 2 input ports are connected in primary processor 1, and entropy decoding association primary processor 2 delivery outlets connect DRAM internal memory 3, and DRAM internal memory 3 is connected to primary processor 1; Primary processor 1 is carried the primary processor 2 in entropy decoding association with audio code stream data block and video codeword data stream frame (audio frequency and video compressed bit stream data), entropy decoding association primary processor 2 is that pcm audio signal and the YCbCr vision signal that television set is accepted delivered to then in DRAM internal memory 3 with the data decode of audio frequency and video compressed bit stream, and primary processor 1 reads the audio signal and the vision signal of decoding from DRAM internal memory 3.Audio output interface and video output interface are connected to primary processor 1; Primary processor 1 is delivered to the pcm audio signal in digital to analog converter 7 and is used for digital-to-analogue conversion and then is output in audio output interface, and the YCbCr vision signal is output in video output interface.Because the module and the operation principle of all the other television sets are prior art, in order to reduce this specification length, therefore be not further described at this, please the reader consult existing technology voluntarily.
Present embodiment and the present invention only describe used as television in method and the device of playing the Real format stream media, but not as limit, same other format stream media file that also can play except that the Real format stream media, as WMV, AVI, can directly adopt pure software decoding to play when playing other format stream media file, certainly also can be with reference to this method broadcast of decoding.
Please refer to Fig. 2, the flow chart of television for play Real format stream media file of the present invention.Adopt the television set of above-mentioned hardware block diagram, its method of playing the Real format stream media comprises following step:
Step P1, the file transfer step is used for the files in stream media that system for TV set reads peripheral storage device Real form, and it specifically comprises following step:
Step P11, system detects step, and whether the television set primary processor detects has the USB peripheral storage device to insert, if, then send message to media manager (running on the functional module in the primary processor), if not, then continue to carry out this step;
Step P12, the notice user steps, media manager inserts the event notice user interface with the USB peripheral storage device;
Step P13, user's operating procedure, user interface show that the USB peripheral storage device inserts prompting, and wait for that the user operates playback of media files;
Step P14, the user selects step, selects the Real format stream media in the peripheral storage device, and gives an order and determine to begin to play;
Step P15, the file transfer step, system for TV set reads the files in stream media of Real form in the peripheral storage device by the USB transmission means, that is to say and meet RM file format (Real Media File Format, RMFF is abbreviated as in the back) the multimedia file data, and with file data input file parsing module;
Step P2, the decoding process step, the primary processor and the cooperation of entropy decoding coprocessor that are used for television set are audio signal and the vision signal that television set is accepted with Real format stream media file decoding; It specifically comprises following step:
Step P21, the document analysis step is used for decompositing Real audio code stream packet and Real video codeword data stream bag from Real format stream media file;
Step P22 unpacks step, is used to unpack Real audio code stream packet and obtains the audio code stream data block, unpacks Real video codeword data stream bag and obtains the video codeword data stream frame;
Step P23, decoding step, be used for television set internal entropy decoding coprocessor and primary processor parallel running, be used for decoded audio bit stream data piece obtaining the audio signal that television set is accepted, and/or be used for decoded video bit stream data frame to obtain the vision signal that television set is accepted;
Step P3 plays step, and audio signal and vision signal are sent into the audio output interface and the video output interface of television set hardware platform respectively, with by the hardware platform playing stream media.
Please refer to Fig. 3, the flow chart of document analysis step of the present invention.Above-mentioned step P21, the decoding process step specifically comprises following step:
Step P210, the beginning step, parsing module enters initial state;
Step P211, determining step judges according to the file header that reads from USB peripheral storage device flag information at the beginning whether this document is Real media file (RMFF file), if, then execution in step P212 if not, then directly withdraws from the REAL decoding and no longer carries out the operation of back;
Step P212 sets up the resolver step, sets up the Real document parser, and the inner parameter of initialization resolver, and the file fetch interface function according to different operating is provided with the file fetch channel then;
Step P213, read the parameter step, resolver reads the self-defining file header of whole RMFF by fetch channel, and reads the file relevant parameter from file header, read the audio stream in the media file and the head of video flowing according to these parameters then, so far document parser has been finished whole initialization;
Step P214, waiting step is waited for calling of upper layer application;
Step P215, the upper layer application invocation step, if call to playing, then deposit order and read next RMFF packet and execution in step P216 successively by the physics of file, if call to stopping, then stop document analysis and close resolver, be redirect, then jump to the user one time execution in step P216 then is set if call;
Step P216, decomposition step according to the head of audio stream and video flowing, decomposites the Real audio code stream packet of user-defined format and Real video codeword data stream bag and with its input data as step P22 from the Real media file.
Please refer to Fig. 4, the flow chart that unpacks step of the present invention.Above-mentioned step P22 unpacks step, specifically comprises following step:
Step P220, the beginning step, parse module enters initial state;
Step P221 sets up the de-packetizer step, sets up de-packetizer and initialization de-packetizer, obtains initialization de-packetizer desired data;
Step P222, waiting step is waited for calling of upper layer application;
Step P223, the upper layer application invocation step be to be play if call, and then execution in step P224 if call to stopping, then stopping file and unpacks and close de-packetizer, is redirect if call, and then jumps to the user one time execution in step P224 then is set;
Step P224, unpack step, will receive Real audio code stream packet and Real video codeword data stream bag from step P216, input video de-packetizer and audio frequency de-packetizer are to unpack respectively, data still are in the state of compressed bit stream after unpacking, with the input data of these data as step P23.
Please refer to Fig. 5, Fig. 5 is the flow chart of decoding step of the present invention.Above-mentioned step P23, decoding step specifically comprises following step:
Step P2300, the beginning step, entropy decoding coprocessor enters initial state;
Step P2301 sets up the DECODE step, sets up DECODE, selects the background decoding mechanism corresponding with form, and the input of DECODE is set then;
Step P2302, waiting step is waited for calling of upper layer application;
Step P2303, the upper layer application invocation step is decoding if call, then execution in step P2304 if call to stopping, then stopping file decoding and closes entropy decoding coprocessor, be redirect if call, then jump to the user one time execution in step P2304 then is set;
Step P2304 receives task step, and entropy decoding coprocessor receives decoding task (task queue of primary processor transmission);
Step P2305, decoding step, entropy decoding coprocessor begins decoding, and with transfer of data in the DRAM internal memory, wait primary processor from the DRAM internal memory, to receive data after, entropy decoding coprocessor turns back to step P2302.
Please refer to Fig. 6, Fig. 6 is the flow chart that primary processor of the present invention and coprocessor cooperate.In conjunction with Fig. 5 and the top decoding step of introducing, following mask body is introduced primary processor and the coprocessor parallel processing in the decoding step, and it cooperates process step to comprise:
Step P231 obtains the decoding task step, and primary processor is obtained a decoding task in order, then this decoding task is put into task queue, then execution in step P232 and step P233;
Step P232, transformation task formation step, primary processor is transmitted in entropy decoding coprocessor with task queue, is in to wait for that receiving the task queue state (also is step P2302, waiting step) the entropy decoding coprocessor in receives decoding task, then entropy decoding coprocessor execution in step P234;
Step P234 carries out the decoding task step, and the decoding coprocessor is carried out decoding task;
Step P2341, the event memory step is output in the DRAM internal memory with result data after the decoding of decoding coprocessor is finished;
Step P2342, the step of giving notice, the decoding coprocessor goes out decoding and finishes notice, gets back to the task queue state (also being step P2302, waiting step) that receives of waiting for then;
Step P233 waits for that notifying process, primary processor judge whether to receive that the decoding that the entropy coprocessor sends finishes notice, if then execution in step P235 if not, then continues to carry out this step;
Step P235 reads the decoded result step, and primary processor reads the decoded result that reads entropy coprocessor output from the DRAM internal memory, execution in step P231 then, and primary processor is obtained next decoding task in order.
The above, only for preferred embodiment of the present invention, so can not limit scope of the invention process with this, i.e. the equivalence of doing according to the present patent application claim and description changes and modification, all should still belong in the scope that patent of the present invention contains.