CN105763938B - GStreamer decrypts the method and device of encryption data - Google Patents
GStreamer decrypts the method and device of encryption data Download PDFInfo
- Publication number
- CN105763938B CN105763938B CN201410778339.4A CN201410778339A CN105763938B CN 105763938 B CN105763938 B CN 105763938B CN 201410778339 A CN201410778339 A CN 201410778339A CN 105763938 B CN105763938 B CN 105763938B
- Authority
- CN
- China
- Prior art keywords
- data
- decryption
- encryption data
- source
- encryption
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/438—Interfacing the downstream path of the transmission network originating from a server, e.g. retrieving MPEG packets from an IP network
Abstract
The invention discloses a kind of methods that GStreamer decrypts encryption data, and this approach includes the following steps:Independent data collection module is created in the duct, the data collection module is integrated in source element, encryption data is collected by data collection module, collected encryption data is transmitted in the queue of source element, and the encryption data is pushed to decryption element;By decrypt element the encryption data is decrypted, and by the data-pushing after decryption to decode element;The data after decryption are decoded by decoding element, with the data after broadcast decoder.The invention also discloses the devices that a kind of GStreamer corresponding with the above method decrypts encryption data.The invention enables the encryption datas of download normally to play in the duct, realizes and encryption data is decrypted, it can be ensured that pipeline normal play encryption data.
Description
Technical field
The present invention relates to stream medium data processing technology fields more particularly to a kind of GStreamer to decrypt encryption data
Method and device.
Background technology
GStreamer core library functions be one processing plug-in unit, data flow and media manipulation frame, some of which plug-in unit
In provide various codecs, also some plug-in units provide other functions, and all inserts
Part can be linked in the pipeline of data flow arbitrarily having been defined for.
Source plug-in unit substantially covers various file formats in current GStreamer plug-in units, for example, the data of single audio frequency
Wma, the element (i.e. plug-in unit) mainly used in pipeline (pipeline) be source elements (i.e. source element), demux elements (i.e.
Demultplexer element), decode elements (decoding element), converter elements (i.e. converters) and sink member
Part (i.e. receiver element), they are built into the processing that a pipeline completes data, and Source elements are responsible for reading for pipeline
The source element of data, demux elements are responsible for carrying out data preliminary processing shunting, and being sent to corresponding sound by caching element regards
Frequency decoder is decoded media data.Decode elements complete decoding function, form YUV component datas, converter members
Part completes the filtering further converted, and video and audio are played to screen and sound card end respectively finally by sink elements.
In conclusion although the visioning procedure of pipeline is very convenient, the plug-in unit that current GStreamer is realized is both for clear
Stream file, and for encryption data, such as band DRM (Data Rights Management, digital copyright management) encryption information
Stream medium data, the decrypting process of encryption data is but realized without corresponding plug-in unit, and cause pipeline play encryption data
Failure.
Invention content
The main purpose of the present invention is to provide the method and devices that a kind of GStreamer decrypts encryption data, it is intended to real
Now encryption data is decrypted, it is ensured that pipeline normal play encryption data.
In order to achieve the above object, the present invention provides a kind of method of GStreamer decryption encryption data, described
The method of GStreamer decryption encryption datas includes the following steps:
Independent data collection module is created in the duct, and the data collection module is integrated in source element;
Encryption data is collected by the data collection module in source element, collected encryption data is transmitted to source element
In the queue created, and the encryption data is pushed to decryption element;
By decrypt element the encryption data is decrypted, and by the data-pushing after decryption to decode element;
The data after decryption are decoded by decoding element, with the data after broadcast decoder.
Preferably, the data collection module by source element collects encryption data, by collected encryption data
It is transmitted in the queue that source element has created, and the step of encryption data is pushed to decryption element includes:
The state that the source element is arranged is to handle state, the adding containing uri attributes that will be transmitted from pipeline
Ciphertext data passes to data collection module, and the encryption data is saved in an extra buffer by data collection module;
The encryption data in buffering area is transmitted in the queue of source element by call back function;
Source is arranged according to the attribute of source element to pad, the encryption data that readjustment comes up is pushed on the source liner, is led to
It crosses the source liner and encryption data is pushed to decryption element.
Preferably, described that the encryption data is decrypted by decrypting element, and the data-pushing after decryption is arrived
Decode element the step of include:
Deciphering module is created, the deciphering module is integrated into the decryption element;
Create the sink liners and src liners of decryption element;
The attribute of decryption element is set according to the manner of decryption of encryption data;
Encryption data is copied to deciphering module in the buffering area of sink liners to be decrypted;
According to the data type after decryption, the data after decoding element push decryption into pipeline.
Preferably, the method for the GStreamer decryption encryption data further includes:
It is created in the duct for collecting and the source element of managing encrypted data;The pipeline is playbin2 pipelines, institute
It is pysrc elements to state source element;
The establishment in the duct is used to collect includes with the step of source element of managing encrypted data:
The URL of source element is identified according to pysrc protocol analysis, searches the pysrc elements for needing to download;
The uri attributes for changing playbin2 pipelines are the attribute corresponding to the pysrc elements;
The pysrc elements are added in pipeline according to uri attributes by playbin2 pipelines;
The attribute of pysrc elements is changed to be at ready state;
The queue for managing the encryption data is created in pysrc elements;
Source is arranged according to the attribute of pysrc elements to pad, the encryption data that the queue is read is pushed to source lining
On pad.
Preferably, the method for the GStreamer decryption encryption data further includes:
Decryption element is created in the duct conciliates symbol part.
In addition, in order to achieve the above object, the present invention also provides the device that a kind of GStreamer decrypts encryption data, institutes
State GStreamer decryption encryption data device include:
Element creation module, for creating independent data collection module in the duct, by the data collection module collection
At in source element;
Data download module is used to collect encryption data by the data collection module in source element, collected will add
Ciphertext data is transmitted in the queue that source element has created, and the encryption data is pushed to decryption element;
Data decryption module is decrypted the encryption data for passing through decryption element, and by the data after decryption
It is pushed to decoding element;
Data decoder module, for being decoded to the data after decryption by decoding element, with the number after broadcast decoder
According to.
Preferably, the data download module is specifically used for:
The state that the source element is arranged is to handle state, the adding containing uri attributes that will be transmitted from pipeline
Ciphertext data passes to data collection module, and the encryption data is saved in an extra buffer by data collection module;
The encryption data in buffering area is transmitted in the queue of source element by call back function;
Source is arranged according to the attribute of source element to pad, the encryption data that readjustment comes up is pushed on the source liner, is led to
It crosses the source liner and encryption data is pushed to decryption element.
Preferably, the data decryption module is specifically used for:
Deciphering module is created, the deciphering module is integrated into the decryption element;
Create the sink liners and src liners of decryption element;
The attribute of decryption element is set according to the manner of decryption of encryption data;
Encryption data is copied to deciphering module in the buffering area of sink liners to be decrypted;
According to the data type after decryption, the data after decoding element push decryption into pipeline.
Preferably, the element creation module is additionally operable to be created in the duct for collecting and the source of managing encrypted data member
Part;The pipeline is playbin2 pipelines, and the source element is pysrc elements;
The element creation module creates in the duct is specially with the source element of managing encrypted data for collecting:
The URL of source element is identified according to pysrc protocol analysis, searches the pysrc elements for needing to download;
The uri attributes for changing playbin2 pipelines are the attribute corresponding to the pysrc elements;
The pysrc elements are added in pipeline according to uri attributes by playbin2 pipelines;
The attribute of pysrc elements is changed to be at ready state;
The queue for managing the encryption data is created in pysrc elements;
Source is arranged according to the attribute of pysrc elements to pad, the encryption data that the queue is read is pushed to source lining
On pad.
Preferably, the element creation module is additionally operable to create decryption element reconciliation symbol part in the duct.
The method and device of GStreamer decryption encryption data provided by the invention, creates independent data in the duct
The data collection module is integrated in source element by collection module, is collected encryption data by the data collection module, will be received
The encryption data of collection is transmitted in the queue that source element has created, and the encryption data is pushed to decryption element, passes through solution
The encryption data is decrypted in close element, and by the data-pushing after decryption to decoding element, so that after decryption
Data can be pushed to corresponding audio decoder plug-in unit and video decoding plug-in after decoding element decoding so that download adds
Ciphertext data can be played normally in the duct.To realize to encryption data (such as the Streaming Media number with DRM encryption information
According to) be decrypted, it can be ensured that pipeline normal play encryption data.
Description of the drawings
Fig. 1 is the flow diagram for one embodiment of method that GStreamer of the present invention decrypts encryption data;
Fig. 2 is the flow diagram of step S20 in Fig. 1;
Fig. 3 is the flow diagram of step S30 in Fig. 1;
Fig. 4 is the flow diagram for another embodiment of method that GStreamer of the present invention decrypts encryption data;
Fig. 5 is the flow diagram of step S50 in Fig. 4;
Fig. 6 is the flow diagram for the another embodiment of method that GStreamer of the present invention decrypts encryption data;
Fig. 7 is the structural schematic diagram for one embodiment of device that GStreamer of the present invention decrypts encryption data.
The realization of the purpose of the present invention, functional characteristics and advantage will in conjunction with the embodiments, and be made furtherly with reference to attached drawing
It is bright.
Specific implementation mode
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of method of GStreamer decryption encryption data, and this method can be applied to VOD (Video On
Demand, video on demand techniques) play in.
Referring to Fig.1, Fig. 1 is the flow diagram for one embodiment of method that GStreamer of the present invention decrypts encryption data.
In first embodiment of the invention, the method for GStreamer decryption encryption data of the present invention includes the following steps:
Step S10:Independent data collection module is created in the duct, and the data collection module is integrated in source element
In;
Step S20:Encryption data is collected by the data collection module in source element, collected encryption data is transmitted
In the queue created to source element, and the encryption data is pushed to decryption element;
Step S30:By decrypt element the encryption data is decrypted, and by the data-pushing after decryption to decode
Element;
Step S40:The data after decryption are decoded by decoding element, with the data after broadcast decoder.
In the present embodiment, the present embodiment collects encryption data by creating data collection module in the duct, by institute
It states data collection module to be integrated into source element, to collect encryption data by source element.By data collection module in source
After in element, encryption data, such as the stream medium data of collection belt DRM encryption information can be collected by data collection module,
The data source of stream medium data with DRM encryption information can be local hard drive data, network server, TV data or the
Tripartite's downloading data.The encryption data downloaded is pushed to decryption element by source element, is received by decrypting element docking
Encryption data be decrypted, and by the data-pushing after decryption to decoding element, by decode element to the data after decryption
It is decoded, with the data after broadcast decoder.
Compared with the existing technology, the method for GStreamer decryption encryption data of the present invention, creates independent number in the duct
It is integrated in source element according to collection module, and by data collection module, to collect encryption data, by decrypting element to source element
The encryption data of collection is decrypted so that the data after decryption can be pushed to corresponding audio after decoding element decoding
Decoding plug-in and video decoding plug-in so that the encryption data of download can be played normally in the duct.To realizing pair plus
Ciphertext data is decrypted, it can be ensured that pipeline normal play encryption data.
Fig. 2 is referred again to, Fig. 2 is the flow diagram of step S20 in Fig. 1.
Based on above-mentioned first embodiment, in second embodiment of the invention, step S20 includes:
Step S21:The state that the source element is arranged is to handle state, contains uri by what is transmitted from pipeline
The encryption data of attribute passes to data collection module, and the encryption data is saved in one by data collection module delays temporarily
It rushes in area;
Step S22:The encryption data in buffering area is transmitted in the queue of source element by call back function;
Step S23:Source is arranged according to the attribute of source element to pad, the encryption data that readjustment comes up, which is pushed to the source, to be served as a contrast
On pad, is padded by the source and encryption data is pushed to decryption element.
The present embodiment by by the state of source element be handling state, handled with the encryption data to collection,
And it will be transmitted from pipeline containing uri (Uniform Resource Identifier, universal resource identifier) attribute
Encryption data passes to data collection module, data source (i.e. local hard drive of the data collection module with specific reference to encryption data
Data, network server, TV data or third party's downloading data), the encryption data of collection is saved in an extra buffer
In.
It, can be by call back function by the encryption data in buffering area after data collection module preserves the encryption data that is collected into
It is transmitted in the queue that source element has created.
After the queue that encryption data is transmitted in source element, source is arranged according to the attribute of source element and is padded, and will be returned
The encryption data being transferred in queue is pushed on the source liner, since the source liner of source element is connect with decryption element, to
It can be padded by source and encryption data is pushed to decryption element.
The encryption data that readjustment comes up specifically is pushed to by g_queue_push_tail () function and has been created by the present embodiment
On the source liner for the source element built up, encryption data is pushed on the liner of source by g_queue_pop_head () function
Buffering area, source liner main function are collection-decryption channel to be established, to decryption element fluidization number evidence to pad source
Encryption data in buffering area is pushed to decryption element.
Fig. 3 is referred again to, Fig. 3 is the flow diagram of step S30 in Fig. 1.
Based on above-mentioned first embodiment, in third embodiment of the invention, step S30 includes:
Step S31:Deciphering module is created, the deciphering module is integrated into the decryption element;
Step S32:Create the sink liners and src liners of decryption element;
Step S33:The attribute of decryption element is set according to the manner of decryption of encryption data;
Step S34:Encryption data is copied to deciphering module in the buffering area of sink liners to be decrypted;
Step S35:According to the data type after decryption, the data after decoding element push decryption into pipeline.
The present embodiment decrypts encryption data by creating deciphering module, meanwhile, the sink liners of decryption element are created, with
The encryption data of reception source liner;The src liners for creating decryption element, after being decrypted to the push of the decoding element of rear end of pipeline
Data.Register caps functions and with chain functions, the liner that is connected is determined by Caps functions, and determine to flow through liner
Between data flow type, the data flowed through can be decrypted by chain functions.To according to encryption data
Manner of decryption decrypts the attribute of element by g_object_set () function setup, and sink liners are copied by chain functions
Encryption data in buffering area is decrypted to deciphering module, according to the data after decryption, judges the class for the data that decryption obtains
Type, the data after the video decoding plug-in into pipeline and the push of audio decoder plug-in unit are decrypted respectively.
During encrypted stream medium data is processed, after stream medium data flows through pysrc elements, either audio is also
It is video data must all be decrypted, processing can be just decoded by decoding element, accordingly, encapsulation is needed to decrypt
Module, encapsulation process need to define the exemplary construction and class formation of new object in header file, decrypt relevant parameter and be all disposed within
In exemplary construction body.
According to the deciphering parameter needs of deciphering module, the attribute of setting member is needed, this can pass through the category of setting GObject
Property complete, the attribute of GObject is defined in _ class_init () function.Specific implementation process can pass through
The pipeline attribute of system function g_object_set () function pair element of GStreamer is modified, can inside decryption element
By execution _ set_property () or _ get_porterty () function, to obtain using the parameter value set.
Sink pads the encryption data passed over for receiving pysrc elements, is arranged since this implementation pads sink
At permanent liner, therefore negotiate here without caps.Because that pysrc elements pass over or with encrypted data,
Can sink liners be directly arranged to static pad, can be by setting GstStaticPadTemplate attribute values specifically
“applacation/playready”.To when the src of pysrc elements liners fluidize data, it will be able to be automatically found decryption
Element, and then decryption element can be connected with source element.And it is data after decrypting toward downstream that src liners, which are responsible for,
Element push is decoded, so setting src, which is padded, there are some difference, it is ANY that src is arranged here to pad parameter, that is, indicates all numbers
According to that can pass through, sink liners and src liners are registered in plugin_init () function, completes setting for decryption component pad
It sets.After the completion of the liner establishment for decrypting element, gst_pad_set_setcaps_function () function is set;Then adjust
The fixation caps attributes of liner are set with gst_pad_set_caps () function, so as to control the data for flowing through liner
Data are respectively transmitted to corresponding video decoding plug-in and audio decoder plug-in unit by type.
In the present embodiment, chain functions are bundled in sink liners, it is ensured that the encryption number to come is fluidized from pysrc elements
According to can directly be handled.For the encryption data come in from sink liner transmission, call drm_decrypt () function complete
At decryption, raw data are formed, the data type after decryption is then judged, calls caps to negotiate, push data into corresponding sound
Frequency decoding element and video decoding element, in the transmittance process of encryption data, in order to enable the audio, video data of processing synchronizes,
Can be in the corresponding timestamp of data markers, the element to subsequently connect can carry out corresponding audio and video number using timestamp
According to synchronization process.
Fig. 4 is referred again to, Fig. 4 is the flow signal for another embodiment of method that GStreamer of the present invention decrypts encryption data
Figure.
Based on above-mentioned first embodiment, in fourth embodiment of the invention, the side of GStreamer decryption encryption data of the present invention
Method further includes before step S10:
Step S50:It is created in the duct for collecting and the source element of managing encrypted data;Wherein, the pipeline is
Playbin2 pipelines, the source element are pysrc elements.
Playbin2 is an advanced pipeline in GStreamer, it can realize the automatic load and connection of element,
It can according to the element characteristic registered in the transformation and element list of the type of data flow automatically assembling from be input to output
A complete conversion chains link.
One is created in playbin2 pipelines for collecting the source element of encryption data, so as to by the stream with drm
Download, the parsing of media data transfer to source element to be managed.
Fig. 5 is referred again to, Fig. 5 is the flow diagram of step S50 in Fig. 4.
Based on above-mentioned fourth embodiment, in fifth embodiment of the invention, step S50 includes:
Step S51:The URL of source element is identified according to pysrc protocol analysis, searches the pysrc elements for needing to download;
Step S52:The uri attributes for changing playbin2 pipelines are the attribute corresponding to the pysrc elements;
Step S53:The pysrc elements are added in pipeline according to uri attributes by playbin2 pipelines;
Step S54:The attribute of pysrc elements is changed to be at ready state;
Step S55:The queue for managing the encryption data is created in pysrc elements;
Step S56:Source is arranged according to the attribute of pysrc elements to pad, the encryption data that the queue is read is pushed away
It is sent on the liner of source.
The access of play system streaming media data be by the URL of Streaming Media (Uniform Resource Locator,
Uniform resource locator) realize, and different source elements is found for different consultations in gstrreamer, to need
First URL is parsed.For the pysrc elements for allowing playbin2 pipelines to find, it is provided with the URL of pysrc agreements, for
When new URL is arranged in new source elements, the iface- of element rewriting is called>Set_uri () function, it is specific corresponding
Function is gst_pysrc_uri_handler_init () function, gst_pysrc_uri_handler_init () function note
Volume four functions _ get_type () function, _ get_protocols () function, _ set_uri () and function _ get_uri ()
Function, these functions mainly complete analysis URL, obtain stream medium data type, transport protocol, new pysrc URL, Yi Jiyu
The corresponding request uri of pysrc URL (universal resource identifier request) are generated and are stored.It is raw when source element starts
At request uri can be transmitted to data collection module, can be prepared as at this time pipeline read data.To according to pysrc
Protocol analysis identifies the URL of source element, by analyzing URL, can find the pysrc elements for needing to download.
In the present embodiment, the attribute of modification pysrc elements is with the detailed process for being at ready state:Pass through
Playbin2 pipelines export source-setup signals after having added pysrc elements;State rewrites function according to above-mentioned source-
Setup signals rewrite the attribute of pysrc elements, and by the ready state that is set as of pysrc elements, that is, prepare state.
The present embodiment completes the management of the buffering area of data collection module by creating queue queues, and queue queues
It is the base class succession of Gstreamer, so as to which external data and gstreamer are united.
The present embodiment is padded by setting source and takes out the encryption data in queue queues, is sent on the liner of source
Buffering area.After pipeline successful connection, decryption element can be passed data to, source liner is preferably arranged to forever by the present embodiment
Setting GstStaticPadTemplate attribute values can be specifically " applacation/ by long liner (i.e. static pad)
playready”.It is arranged to dynamic pad in addition, according to actual needs source can also be padded, this is not restricted.
Fig. 6 is referred again to, Fig. 6 is the flow signal for the another embodiment of method that GStreamer of the present invention decrypts encryption data
Figure.
Based on above-described embodiment, in sixth embodiment of the invention, the method for GStreamer decryption encryption data of the present invention exists
Further include before step S10:
Step S60:Decryption element is created in the duct conciliates symbol part.
The present embodiment is decrypted encryption data by creating decryption element in the duct, so as to realize
Stream medium data containing encryption information is decrypted, it is ensured that the normal play of stream medium data.
The present invention also provides the devices that a kind of GStreamer decrypts encryption data.
It is the structural schematic diagram for one embodiment of device that GStreamer of the present invention decrypts encryption data with reference to Fig. 7, Fig. 7.
As shown in fig. 7, the device of the GStreamer decryption encryption data includes:
Element creation module 100, for creating independent data collection module in the duct, by the data collection module
It is integrated in source element;
Data download module 200, the encryption data for being collected by source element, and the encryption data is pushed to solution
Close element;
Data decryption module 300 is decrypted the encryption data for passing through decryption element, and by the number after decryption
According to being pushed to decoding element;
Data decoder module 400, for being decoded to the data after decryption by decoding element, after broadcast decoder
Data.
In the present embodiment, element creation module 100 creates independent data collection module in the duct, by the data
Collection module is in source element, with by collecting encryption data by source element.The number that data download module 200 passes through source element
Encryption data, such as the stream medium data of collection belt DRM encryption information, the stream matchmaker with DRM encryption information are collected according to collection module
The data source of volume data can be local hard drive data, network server, TV data or third party's downloading data.Under data
It carries module 200 and the encryption data downloaded is pushed to by decryption element by source element, data decryption module 300 passes through decryption element
The encryption data received is decrypted in part, and by the data-pushing after decryption to decoding element, and data decoder module 400 is logical
It crosses decoding element to be decoded the data after decryption, with the data after broadcast decoder.
Compared with the existing technology, the device of GStreamer decryption encryption data of the present invention, creates independent number in the duct
It is integrated in source element according to collection module, and by data collection module, to collect encryption data, by decrypting element to source element
The encryption data of collection is decrypted so that the data after decryption can be pushed to corresponding audio after decoding element decoding
Decoding plug-in and video decoding plug-in so that the encryption data of download can be played normally in the duct.To realizing pair plus
Ciphertext data is decrypted, it can be ensured that pipeline normal play encryption data.
Specifically, the data download module 200 is specifically used for:
The state that the source element is arranged is to handle state, the adding containing uri attributes that will be transmitted from pipeline
Ciphertext data passes to data collection module, and the encryption data is saved in an extra buffer by data collection module;
The encryption data in buffering area is transmitted in the queue of source element by call back function;
Source is arranged according to the attribute of source element to pad, the encryption data that readjustment comes up is pushed on the source liner, is led to
It crosses the source liner and encryption data is pushed to decryption element.
The present embodiment by by the state of source element be handling state, handled with the encryption data to collection,
And it will be transmitted from pipeline containing uri (Uniform Resource Identifier, universal resource identifier) attribute
Encryption data passes to data collection module, data source (i.e. local hard drive of the data collection module with specific reference to encryption data
Data, network server, TV data or third party's downloading data), the encryption data of collection is saved in an extra buffer
In.
It, can be by call back function by the encryption data in buffering area after data collection module preserves the encryption data that is collected into
It is transmitted in the queue that source element has created.
After the queue that encryption data is transmitted in source element, source is arranged according to the attribute of source element and is padded, and will be returned
The encryption data being transferred in queue is pushed on the source liner, since the source liner of source element is connect with decryption element, to
It can be padded by source and encryption data is pushed to decryption element.
The encryption data that readjustment comes up specifically is pushed to by g_queue_push_tail () function and has been created by the present embodiment
On the source liner for the source element built up, encryption data is pushed on the liner of source by g_queue_pop_head () function
Buffering area, source liner main function are collection-decryption channel to be established, to decryption element fluidization number evidence to pad source
Encryption data in buffering area is pushed to decryption element.
Specifically, the data decryption module 300 is specifically used for:
Deciphering module is created, the deciphering module is integrated into the decryption element;
Create the sink liners and src liners of decryption element;
The attribute of decryption element is set according to the manner of decryption of encryption data;
Encryption data is copied to deciphering module in the buffering area of sink liners to be decrypted;
According to the data type after decryption, the data after decoding element push decryption into pipeline.
The present embodiment decrypts encryption data by creating deciphering module, meanwhile, the sink liners of decryption element are created, with
The encryption data of reception source liner;The src liners for creating decryption element, after being decrypted to the push of the decoding element of rear end of pipeline
Data.Register caps functions and with chain functions, the liner that is connected is determined by Caps functions, and determine to flow through liner
Between data flow type, the data flowed through can be decrypted by chain functions.To according to encryption data
Manner of decryption decrypts the attribute of element by g_object_set () function setup, and sink liners are copied by chain functions
Encryption data in buffering area is decrypted to deciphering module, according to the data after decryption, judges the class for the data that decryption obtains
Type, the data after the video decoding plug-in into pipeline and the push of audio decoder plug-in unit are decrypted respectively.
During encrypted stream medium data is processed, after stream medium data flows through pysrc elements, either audio is also
It is video data must all be decrypted, processing can be just decoded by decoding element, accordingly, encapsulation is needed to decrypt
Module, encapsulation process need to define the exemplary construction and class formation of new object in header file, decrypt relevant parameter and be all disposed within
In exemplary construction body.
According to the deciphering parameter needs of deciphering module, the attribute of setting member is needed, this can pass through the category of setting GObject
Property complete, the attribute of GObject is defined in _ class_init () function.Specific implementation process can pass through
The pipeline attribute of system function g_object_set () function pair element of GStreamer is modified, can inside decryption element
By execution _ set_property () or _ get_porterty () function, to obtain using the parameter value set.
Sink pads the encryption data passed over for receiving pysrc elements, is arranged since this implementation pads sink
At permanent liner, therefore negotiate here without caps.Because that pysrc elements pass over or with encrypted data,
Can sink liners be directly arranged to static pad, can be by setting GstStaticPadTemplate attribute values specifically
“applacation/playready”.To when the src of pysrc elements liners fluidize data, it will be able to be automatically found decryption
Element, and then decryption element can be connected with source element.And it is data after decrypting toward downstream that src liners, which are responsible for,
Element push is decoded, so setting src, which is padded, there are some difference, it is ANY that src is arranged here to pad parameter, that is, indicates all numbers
According to that can pass through, sink liners and src liners are registered in plugin_init () function, completes setting for decryption component pad
It sets.After the completion of the liner establishment for decrypting element, gst_pad_set_setcaps_function () function is set;Then adjust
The fixation caps attributes of liner are set with gst_pad_set_caps () function, so as to control the data for flowing through liner
Data are respectively transmitted to corresponding video decoding plug-in and audio decoder plug-in unit by type.
In the present embodiment, chain functions are bundled in sink liners, it is ensured that the encryption number to come is fluidized from pysrc elements
According to can directly be handled.For the encryption data come in from sink liner transmission, call drm_decrypt () function complete
At decryption, raw data are formed, the data type after decryption is then judged, calls caps to negotiate, push data into corresponding sound
Frequency decoding element and video decoding element, in the transmittance process of encryption data, in order to enable the audio, video data of processing synchronizes,
Can be in the corresponding timestamp of data markers, the element to subsequently connect can carry out corresponding audio and video number using timestamp
According to synchronization process.
Specifically, element creation module 100 is additionally operable to be created in the duct for collecting and the source of managing encrypted data member
Part;Wherein, the pipeline is playbin2 pipelines, and the source element is pysrc elements.
Playbin2 is an advanced pipeline in GStreamer, it can realize the automatic load and connection of element,
It can according to the element characteristic registered in the transformation and element list of the type of data flow automatically assembling from be input to output
A complete conversion chains link.
One is created in playbin2 pipelines for collecting the source element of encryption data, so as to by the stream with drm
Download, the parsing of media data transfer to source element to be managed.
Wherein, the element creation module 100 is created in the duct for collecting and the source element of managing encrypted data tool
Body is:
The URL of source element is identified according to pysrc protocol analysis, searches the pysrc elements for needing to download;
The uri attributes for changing playbin2 pipelines are the attribute corresponding to the pysrc elements;
The pysrc elements are added in pipeline according to uri attributes by playbin2 pipelines;
The attribute of pysrc elements is changed to be at ready state;
The queue for managing the encryption data is created in pysrc elements;
Source is arranged according to the attribute of pysrc elements to pad, the encryption data that the queue is read is pushed to source lining
On pad.
The access of play system streaming media data be by the URL of Streaming Media (Uniform Resource Locator,
Uniform resource locator) realize, and different source elements is found for different consultations in gstrreamer, to need
First URL is parsed.For the pysrc elements for allowing playbin2 pipelines to find, it is provided with the URL of pysrc agreements, for
When new URL is arranged in new source elements, the iface- of element rewriting is called>Set_uri () function, it is specific corresponding
Function is gst_pysrc_uri_handler_init () function, gst_pysrc_uri_handler_init () function note
Volume four functions _ get_type () function, _ get_protocols () function, _ set_uri () and function _ get_uri ()
Function, these functions mainly complete analysis URL, obtain stream medium data type, transport protocol, new pysrc URL, Yi Jiyu
The corresponding request uri of pysrc URL (universal resource identifier request) are generated and are stored.It is raw when source element starts
At request uri can be transmitted to data collection module, can be prepared as at this time pipeline read data.To according to pysrc
Protocol analysis identifies the URL of source element, by analyzing URL, can find the pysrc elements for needing to download.
In the present embodiment, the attribute of modification pysrc elements is with the detailed process for being at ready state:Pass through
Playbin2 pipelines export source-setup signals after having added pysrc elements;State rewrites function according to above-mentioned source-
Setup signals rewrite the attribute of pysrc elements, and by the ready state that is set as of pysrc elements, that is, prepare state.
The present embodiment completes the management of the buffering area of data collection module by creating queue queues, and queue queues
It is the base class succession of Gstreamer, so as to which external data and gstreamer are united.
The present embodiment is padded by setting source and takes out the encryption data in queue queues, is sent on the liner of source
Buffering area.After pipeline successful connection, decryption element can be passed data to, source liner is preferably arranged to forever by the present embodiment
Setting GstStaticPadTemplate attribute values can be specifically " applacation/ by long liner (i.e. static pad)
playready”.It is arranged to dynamic pad in addition, according to actual needs source can also be padded, this is not restricted.
Specifically, the element creation module 100 is additionally operable to create decryption element reconciliation symbol part in the duct.
The present embodiment creates decryption element by element creation module 100 place is decrypted to encryption data in the duct
Reason, is decrypted the stream medium data containing encryption information so as to realize, it is ensured that the normal play of stream medium data.
The foregoing is merely the preferred embodiment of the present invention, are not intended to limit the scope of the invention, every utilization
Equivalent structure or equivalent flow shift made by description of the invention and accompanying drawing content is applied directly or indirectly in other correlations
Technical field, be included within the scope of the present invention.
Claims (10)
1. a kind of method of GStreamer decryption encryption data, which is characterized in that the GStreamer decryption encryption data
Method includes the following steps:
Independent data collection module is created in the duct, and the data collection module is integrated in source element;
Encryption data is collected by the data collection module in source element, collected encryption data is transmitted to source element and has been created
In the queue built, and the encryption data is pushed to decryption element;
By decrypt element the encryption data is decrypted, and by the data-pushing after decryption to decode element;
The data after decryption are decoded by decoding element, with the data after broadcast decoder.
2. the method for GStreamer decryption encryption data as described in claim 1, which is characterized in that described to pass through source element
In data collection module collect encryption data, collected encryption data is transmitted in the queue that source element has created, and
The encryption data, which is pushed to the step of decrypting element, includes:
The state that the source element is arranged is to handle state, the encryption number containing uri attributes that will be transmitted from pipeline
According to data collection module is passed to, the encryption data is saved in an extra buffer by data collection module;
The encryption data in buffering area is transmitted in the queue of source element by call back function;
Source is arranged according to the attribute of source element to pad, the encryption data that readjustment comes up is pushed on the source liner, institute is passed through
It states source liner and encryption data is pushed to decryption element.
3. the method for GStreamer decryption encryption data as described in claim 1, which is characterized in that described to pass through decryption element
The encryption data is decrypted in part, and includes by the data-pushing after decryption to the step of decoding element:
Deciphering module is created, the deciphering module is integrated into the decryption element;
Create the sink liners and src liners of decryption element;
The attribute of decryption element is set according to the manner of decryption of encryption data;
Encryption data is copied to deciphering module in the buffering area of sink liners to be decrypted;
According to the data type after decryption, the data after decoding element push decryption into pipeline.
4. the method for GStreamer decryption encryption data as described in claim 1, which is characterized in that the GStreamer solutions
The method of close encryption data further includes:
It is created in the duct for collecting and the source element of managing encrypted data;The pipeline is playbin2 pipelines, the source
Element is pysrc elements;
The establishment in the duct is used to collect includes with the step of source element of managing encrypted data:
The URL of source element is identified according to pysrc protocol analysis, searches the pysrc elements for needing to download;
The uri attributes for changing playbin2 pipelines are the attribute corresponding to the pysrc elements;
The pysrc elements are added in pipeline according to uri attributes by playbin2 pipelines;
The attribute of pysrc elements is changed to be at ready state;
The queue for managing the encryption data is created in pysrc elements;
Source is arranged according to the attribute of pysrc elements to pad, the encryption data that the queue is read is pushed on the liner of source.
5. the method for GStreamer decryption encryption data according to any one of claims 1 to 4, which is characterized in that described
GStreamer decryption encryption data method further include:
Decryption element is created in the duct conciliates symbol part.
6. a kind of device of GStreamer decryption encryption data, which is characterized in that the GStreamer decryption encryption data
Device includes:
The data collection module is integrated in by element creation module for creating independent data collection module in the duct
In source element;
Data download module, for collecting encryption data by the data collection module in source element, by collected encryption number
According to being transmitted in the queue that source element has created, and the encryption data is pushed to decryption element;
Data decryption module is decrypted the encryption data for passing through decryption element, and by the data-pushing after decryption
To decoding element;
Data decoder module, for being decoded to the data after decryption by decoding element, with the data after broadcast decoder.
7. the device of GStreamer decryption encryption data as claimed in claim 6, which is characterized in that the data download mould
Block is specifically used for:
The state that the source element is arranged is to handle state, the encryption number containing uri attributes that will be transmitted from pipeline
According to data collection module is passed to, the encryption data is saved in an extra buffer by data collection module;
The encryption data in buffering area is transmitted in the queue of source element by call back function;
Source is arranged according to the attribute of source element to pad, the encryption data that readjustment comes up is pushed on the source liner, institute is passed through
It states source liner and encryption data is pushed to decryption element.
8. the device of GStreamer decryption encryption data as claimed in claim 6, which is characterized in that the data deciphering mould
Block is specifically used for:
Deciphering module is created, the deciphering module is integrated into the decryption element;
Create the sink liners and src liners of decryption element;
The attribute of decryption element is set according to the manner of decryption of encryption data;
Encryption data is copied to deciphering module in the buffering area of sink liners to be decrypted;
According to the data type after decryption, the data after decoding element push decryption into pipeline.
9. the device of GStreamer decryption encryption data as claimed in claim 6, which is characterized in that the element creates mould
Block is additionally operable to be created in the duct for collecting and the source element of managing encrypted data;The pipeline is playbin2 pipelines, institute
It is pysrc elements to state source element;
The element creation module creates in the duct is specially with the source element of managing encrypted data for collecting:
The URL of source element is identified according to pysrc protocol analysis, searches the pysrc elements for needing to download;
The uri attributes for changing playbin2 pipelines are the attribute corresponding to the pysrc elements;
The pysrc elements are added in pipeline according to uri attributes by playbin2 pipelines;
The attribute of pysrc elements is changed to be at ready state;
The queue for managing the encryption data is created in pysrc elements;
Source is arranged according to the attribute of pysrc elements to pad, the encryption data that the queue is read is pushed on the liner of source.
10. the device of the GStreamer decryption encryption datas as described in any one of claim 6 to 9, which is characterized in that institute
Element creation module is stated to be additionally operable to create decryption element reconciliation symbol part in the duct.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410778339.4A CN105763938B (en) | 2014-12-15 | 2014-12-15 | GStreamer decrypts the method and device of encryption data |
PCT/CN2014/094303 WO2016095183A1 (en) | 2014-12-15 | 2014-12-19 | Method and device for encrypting and decrypting data by gstreamer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410778339.4A CN105763938B (en) | 2014-12-15 | 2014-12-15 | GStreamer decrypts the method and device of encryption data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105763938A CN105763938A (en) | 2016-07-13 |
CN105763938B true CN105763938B (en) | 2018-09-04 |
Family
ID=56125643
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410778339.4A Active CN105763938B (en) | 2014-12-15 | 2014-12-15 | GStreamer decrypts the method and device of encryption data |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105763938B (en) |
WO (1) | WO2016095183A1 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108322821A (en) * | 2018-02-28 | 2018-07-24 | 北京酷我科技有限公司 | A kind of audio play in data buffering strategy |
CN109194698A (en) * | 2018-11-01 | 2019-01-11 | 浩云科技股份有限公司 | A kind of Real-time Video Processing System and method based on GStreamer frame |
CN110536173B (en) * | 2019-08-27 | 2021-04-20 | 海信集团有限公司 | Method and device for connecting elements in data stream link |
CN113489705B (en) * | 2021-06-30 | 2023-03-24 | 中国银联股份有限公司 | Method and device storage medium for capturing HTTP (hyper text transport protocol) communication data of application program |
CN114071235B (en) * | 2021-11-10 | 2022-12-13 | 四川长虹电器股份有限公司 | Method for improving play black screen performance of player based on gstreamer |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102984571A (en) * | 2012-12-07 | 2013-03-20 | 青岛海信信芯科技有限公司 | External data reading method of Gstreamer in digital television and device thereof |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050129246A1 (en) * | 2003-12-16 | 2005-06-16 | Glenn Gearhart | Intelligent digital secure LockBox and access key distribution system (DLB) |
US20070033596A1 (en) * | 2005-04-14 | 2007-02-08 | Kridner Jason D | Reconfigurable State Structure Based System Design for Embedded Multimedia System |
CN103414726A (en) * | 2013-08-22 | 2013-11-27 | 天脉聚源(北京)传媒科技有限公司 | Method and device for transmitting multimedia resources |
-
2014
- 2014-12-15 CN CN201410778339.4A patent/CN105763938B/en active Active
- 2014-12-19 WO PCT/CN2014/094303 patent/WO2016095183A1/en active Application Filing
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102984571A (en) * | 2012-12-07 | 2013-03-20 | 青岛海信信芯科技有限公司 | External data reading method of Gstreamer in digital television and device thereof |
Non-Patent Citations (2)
Title |
---|
AN HTML5 PLAYER FOR A GSTREAMER BASED MPEG DASH CLIENT;E.Quacchio等;《Visual Communications and Image Processing(VCIP),2012》;20130117;全文 * |
基于GStreamer框架的机顶盒仿真器的设计与实现;沈卫忠;《信息科技辑》;20140815(第2014年第08期);第43-47页 * |
Also Published As
Publication number | Publication date |
---|---|
CN105763938A (en) | 2016-07-13 |
WO2016095183A1 (en) | 2016-06-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105763938B (en) | GStreamer decrypts the method and device of encryption data | |
JP7015617B2 (en) | Content transmission / reception method and equipment | |
US11265615B2 (en) | Transmission apparatus, transmission method, reception apparatus, and reception method | |
JP5202947B2 (en) | Audio / video content protection method | |
US9654810B2 (en) | Mechanism for partial encryption of data streams | |
US8671452B2 (en) | Apparatus and method for moving rights object from one device to another device via server | |
US7584290B2 (en) | Session mobility using digital items | |
TWI381736B (en) | Method and apparatus for importing a transport stream | |
KR101268798B1 (en) | Communicating media content from a dvr to a portable device | |
US20090044241A1 (en) | Broadcasting content protection/management system | |
US20070005775A1 (en) | Peer device data transfer | |
EP2420952A2 (en) | System and method for protecting digital media content | |
EP2003587A2 (en) | Content download | |
WO2014175640A1 (en) | Method and apparatus for transmitting and receiving broadcasting data by using mmt in digital broadcasting system | |
NL2001444C2 (en) | POWER PROCESSING DEVICE AND STORAGE DEVICE. | |
WO2016062092A1 (en) | Method and mobile terminal for processing encrypted video | |
CN105847869B (en) | A kind of encryption playback method and device | |
JP2010541040A (en) | Content protection providing method, protected content consumption method and apparatus thereof | |
WO2019129116A1 (en) | Video recording method and device | |
CN100403748C (en) | AV communication control integrated circuit | |
CA2542864A1 (en) | Content distribution system, content server, content receiving apparatus, content distribution method, program and recording medium | |
JP2010508795A (en) | Compressed multimedia file control editing broadcast method and device | |
JP2006129078A (en) | Data file editing method and apparatus thereof, control program, and storage medium | |
KR102153554B1 (en) | MMT apparatus and method for processing media data | |
Serrão et al. | From OPIMA to MPEG IPMP-X: A standard's history across R&D projects |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |