Display apparatus and method
The disclosure provides a display apparatus and a method. In response to a first command from a user, the display apparatus can obtain media data of a target channel and execute a first process and a second process in parallel. The first process can include demultiplexing the data segment to obtain ES data and obtaining first metadata information according to the encryption data and first ES data. The second process can include predicting second metadata information according to the attribute parameter and the encryption data. Based on that the second metadata information is generated before the first metadata information, the display apparatus can initialize a decoder according to the second metadata information, decode the ES data via the initialized decoder to obtain decoded ES data, and display a program image of the target channel on the display according to the decoded ES data.
1 . A display apparatus, comprising:
a display;
a control device, in communication with the display; and
at least one processor, connected with the display and the control device, and configured to execute computer instructions to cause the display apparatus to:
in response to a first command input via the control device from a user, obtain media data of a target channel, wherein the media data comprises an index file and a data segment, and the index file comprises an attribute parameter for describing attribute characteristics of the data segment and encryption data;
execute a first process and a second process in parallel; wherein
the first process comprises demultiplexing the data segment to obtain Elementary Stream (ES) data, and obtaining first metadata information for describing attribute of the data segment according to the encryption data and first ES data; and
the second process comprises generating second metadata information for describing attribute of the data segment according to the attribute parameter and the encryption data; wherein
both of the first metadata information and the second metadata information are usable for initializing a decoder;
both of the first metadata information and the second metadata information describe at least audio and video attribute information of the same data segment, and the audio and video attribute information comprises: a width and a height of video, a Multipurpose Internet Mail Extensions (MIME) type of video, a MIME type of audio, a sampling rate, and channel information;
based on that the second metadata information is generated before the first metadata information, initialize the decoder according to the second metadata information;
determine whether the first metadata information is consistent with the second metadata information;
based on that the first metadata information and the second metadata information is consistent, decode the ES data via the decoder initialized according to the second metadata information to obtain first decoded ES data;
based on that the first metadata information and the second metadata information is not consistent, turn off the decoder initialized according to the second metadata information, and reinitialize the decoder according to the first metadata information, and decode the ES data via the decoder reinitialized according to the first metadata information to obtain second decoded ES data;
based on that the first metadata information is generated before the second metadata information, initialize the decoder according to the first metadata information and terminate the second process, and decode the ES data via the decoder initialized according to the first metadata information to obtain third decoded ES data; and
display a program image of the target channel on the display according to one of the first decoded ES data, the second decoded ES data, and the third decoded ES data.
2 . The display apparatus of claim 1 , wherein the at least one processor is further configured to execute computer instructions to cause the display apparatus to:
obtain a radio frequency data stream;
parse the radio frequency data stream according to a specified protocol to obtain data in a specified format; and
extract the data in the specified format to obtain the media data, wherein in the media data, media data with transport stream interface TSI=0 is the index file, and media data with TSI>0 is the data segment.
3 . The display apparatus of claim 1 , wherein the at least one processor is further configured to execute computer instructions to cause the display apparatus to:
generate first attribute information in the second metadata information according to the attribute parameter, wherein the first attribute information is used to describe the audio and video attribute information of the data segment; and
generate second attribute information in the second metadata information based on the encryption data, wherein the second attribute information is used to describe encryption information of the data segment.
4 . The display apparatus of claim 3 , wherein the at least one processor is further configured to execute computer instructions to cause the display apparatus to:
identify a parameter at a specified position in the attribute parameter; and
take the parameter at the specified position as the first attribute information in the second metadata information; and
based on that the attribute parameter is null, take default attribute information as the first attribute information in the second metadata information.
5 . The display apparatus of claim 3 , wherein the at least one processor is further configured to execute computer instructions to cause the display apparatus to:
based on that the encryption data comprises an encryption tag, determine that the second attribute information is encrypted; and
based on the encryption data does not comprise an encryption tag, determine that the second attribute information is not encrypted.
6 . The display apparatus of claim 1 , wherein the at least one processor is further configured to execute computer instructions to cause the display apparatus to:
obtain first key information from the first metadata information and second key information from the second metadata information; and
determine whether the first key information is same as the second key information.
7 . The display apparatus of claim 1 , wherein the first command is a channel switching command and the first command is received during displaying of a first channel on the display, and the at least one processor is further configured to execute computer instructions to cause the display apparatus to:
determine whether the target channel and the first channel belong to a same frequency before executing the first process and the second process in parallel;
based on that the target channel and the first channel belong to the same frequency, obtain third metadata information, wherein the third metadata information is metadata information used to initialize the decoder when decoding ES data of the first channel;
initialize the decoder using the third metadata information; and
based on that the target channel and the first channel belong to different frequencies, execute the first process and the second process in parallel.
8 . A method for a display apparatus, comprising:
in response to a first command input via a control device of the display apparatus from a user, obtaining media data of a target channel, wherein the media data comprises an index file and a data segment, and the index file comprises an attribute parameter for describing attribute characteristics of the data segment and encryption data;
executing a first process and a second process in parallel;
wherein the first process comprises demultiplexing the data segment to obtain Elementary Stream (ES) data, and obtaining first metadata information for describing attribute of the data segment according to the encryption data and first ES data; and
the second process comprises generating second metadata information for describing attribute of the data segment according to the attribute parameter and the encryption data; wherein
both of the first metadata information and the second metadata information are usable for initializing a decoder;
both of the first metadata information and the second metadata information describe at least audio and video attribute information of the same data segment, and the audio and video attribute information comprises: a width and a height of video, a Multipurpose Internet Mail Extensions (MIME) type of video, a MIME type of audio, a sampling rate, and channel information;
based on that the second metadata information is generated before the first metadata information, initializing the decoder according to the second metadata information;
determining whether the first metadata information is consistent with the second metadata information;
based on that the first metadata information and the second metadata information is consistent, decoding the ES data via the decoder initialized according to the second metadata information to obtain first decoded ES data;
based on that the first metadata information and the second metadata information is not consistent, turning off the decoder initialized according to the second metadata information, and reinitializing the decoder according to the first metadata information, and decoding the ES data via the decoder reinitialized according to the first metadata information to obtain second decoded ES data;
based on that the first metadata information is generated before the second metadata information, initializing the decoder according to the first metadata information and terminating the second process, and decoding the ES data via the decoder initialized according to the first metadata information to obtain third decoded ES data; and
displaying a program image of the target channel on a display of the display apparatus according to one of the first decoded ES data, the second decoded ES data, and the third decoded ES data.
9 . The method of claim 8 , further comprising:
obtaining a radio frequency data stream;
parsing the radio frequency data stream according to a specified protocol to obtain data in a specified format; and
extracting the data in the specified format to obtain the media data, wherein in the media data, media data with transport stream interface TSI=0 is the index file, and media data with TSI>0 is the data segment.
10 . The method of claim 8 , further comprising:
generating first attribute information in the second metadata information according to the attribute parameter, wherein the first attribute information is used to describe audio and video attribute information of the data segment; and
generating second attribute information in the second metadata information based on the encryption data, wherein the second attribute information is used to describe encryption information of the data segment.
11 . The method of claim 10 , further comprising:
identifying a parameter at a specified position in the attribute parameter; and
taking the parameter at the specified position as the first attribute information in the second metadata information; and
based on that the attribute parameter is null, taking default attribute information as the first attribute information in the second metadata information.
12 . The method of claim 10 , further comprising:
based on that the encryption data comprises an encryption tag, determining that the second attribute information is encrypted; and
based on that the encryption data does not comprise an encryption tag, determining that the second attribute information is not encrypted.
13 . The method of claim 8 , further comprising:
obtaining first key information from the first metadata information and second key information from the second metadata information; and
determining whether the first key information is same as the second key information.
14 . The method of claim 8 , wherein the first command is a channel switching command and the first command is received during displaying of a first channel on the display, and the method further comprises:
determining whether the target channel and the first channel belong to a same frequency before executing the first process and the second process in parallel;
based on that the target channel and the first channel belong to the same frequency, obtaining third metadata information, wherein the third metadata information is metadata information used to initialize the decoder when decoding ES data of the first channel;
initializing the decoder using the third metadata information; and
based on that the target channel and the first channel belong to different frequencies, executing the first process and the second process in parallel.