WO2016095183A1 - Method and device for encrypting and decrypting data by gstreamer - Google Patents

Method and device for encrypting and decrypting data by gstreamer Download PDF

Info

Publication number
WO2016095183A1
WO2016095183A1 PCT/CN2014/094303 CN2014094303W WO2016095183A1 WO 2016095183 A1 WO2016095183 A1 WO 2016095183A1 CN 2014094303 W CN2014094303 W CN 2014094303W WO 2016095183 A1 WO2016095183 A1 WO 2016095183A1
Authority
WO
WIPO (PCT)
Prior art keywords
component
encrypted data
data
source
decryption
Prior art date
Application number
PCT/CN2014/094303
Other languages
French (fr)
Chinese (zh)
Inventor
陈耀宗
Original Assignee
深圳Tcl数字技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 深圳Tcl数字技术有限公司 filed Critical 深圳Tcl数字技术有限公司
Publication of WO2016095183A1 publication Critical patent/WO2016095183A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/438Interfacing the downstream path of the transmission network originating from a server, e.g. retrieving MPEG packets from an IP network

Definitions

  • the present invention relates to the field of streaming media data processing technologies, and in particular, to a GStreamer method and apparatus for decrypting encrypted data.
  • GStreamer is an open source streaming media framework. GStreamer is based on plugins. Some of the plugins provide a variety of multimedia digital codecs, and some plugins provide other functions. All plugins can be linked. Go to any of the defined data flow pipelines.
  • the source plug-ins in the current GStreamer plug-in basically cover various file formats, for example, single-audio data wma
  • the main components used in the pipeline are source components (ie source components), demux components ( That is, the demultiplexer component), the decode component (ie, the decoding component), the converter component (ie, the converter component), and the sink component (ie, the receiver component), which are constructed as a pipeline to complete the processing of the data
  • the Source component is responsible for the pipeline.
  • the source component of the read data, the demux component is responsible for preliminary processing and shunting of the data, and the buffer component is sent to the corresponding audio and video decoder to decode the media data.
  • the decode component completes the decoding function, forms the YUV component data, the converter component performs the further conversion filtering, and finally plays the video and audio to the screen and the sound card end respectively through the sink component.
  • the main object of the present invention is to provide a method and device for decrypting encrypted data by GStreamer, aiming at decrypting encrypted data and ensuring that the pipeline plays encrypted data normally.
  • the present invention provides a method for GStreamer to decrypt encrypted data, and the method for decrypting encrypted data by the GStreamer includes the following steps:
  • the decrypted data is decoded by the decoding component to play the decoded data.
  • the step of collecting the encrypted data by the data collection module in the source component, transferring the collected encrypted data to a queue that the source component has created, and pushing the encrypted data to the decryption component comprises:
  • the source pad is set according to the attributes of the source element, and the encrypted data from the callback is pushed onto the source pad, and the encrypted data is pushed to the decryption element by the source pad.
  • the step of decrypting the encrypted data by the decryption component and pushing the decrypted data to the decoding component comprises:
  • the decrypted data is pushed to the decoding component in the pipeline according to the decrypted data type.
  • the method for decrypting the encrypted data by the GStreamer further includes:
  • Creating a source element for collecting and managing encrypted data in a pipeline the pipeline is a playbin2 pipeline, and the source component is a pysrc component;
  • the steps of creating a source component for collecting and managing encrypted data in the pipeline include:
  • the source pad is set according to the attributes of the pysrc element to push the encrypted data read by the queue onto the source pad.
  • the method for decrypting the encrypted data by the GStreamer further includes:
  • a decryption element and a decoding element are created in the pipeline.
  • the present invention further provides an apparatus for decrypting encrypted data by a GStreamer, where the apparatus for decrypting encrypted data by the GStreamer includes:
  • a component creation module configured to create an independent data collection module in the pipeline, and the data collection module is in the source component
  • a data downloading module configured to collect encrypted data by using a data collection module in the source component, transfer the collected encrypted data to a queue that the source component has created, and push the encrypted data to the decryption component;
  • a data decryption module configured to decrypt the encrypted data by a decryption component, and push the decrypted data to a decoding component
  • the data decoding module is configured to decode the decrypted data by the decoding component to play the decoded data.
  • the data download module is specifically configured to:
  • the source pad is set according to the attributes of the source element, and the encrypted data from the callback is pushed onto the source pad, and the encrypted data is pushed to the decryption element by the source pad.
  • the data decryption module is specifically configured to:
  • the decrypted data is pushed to the decoding component in the pipeline according to the decrypted data type.
  • the component creation module is further configured to create a source component for collecting and managing encrypted data in a pipeline;
  • the pipeline is a playbin2 pipeline, and the source component is a pysrc component;
  • the component creation module creates a source component in the pipeline for collecting and managing encrypted data, specifically:
  • the source pad is set according to the attributes of the pysrc element to push the encrypted data read by the queue onto the source pad.
  • the component creation module is further configured to create a decryption component and a decoding component in the pipeline.
  • the method and device for decrypting encrypted data by the GStreamer create an independent data collection module in the pipeline, integrate the data collection module in the source component, collect the encrypted data through the data collection module, and transmit the collected encrypted data. Going to the queue in which the source component has been created, and pushing the encrypted data to the decryption component, decrypting the encrypted data by the decryption component, and pushing the decrypted data to the decoding component, so that the decrypted data can pass through After decoding, the decoding component is pushed to the corresponding audio decoding plug-in and video decoding plug-in, so that the downloaded encrypted data can be played normally in the pipeline. Thereby, the encrypted data (such as streaming media data with DRM encrypted information) is decrypted, and the pipeline can ensure that the encrypted data is played normally.
  • the encrypted data such as streaming media data with DRM encrypted information
  • FIG. 1 is a schematic flowchart of a method for decrypting encrypted data by GStreamer according to an embodiment of the present invention
  • step S20 in FIG. 1 is a schematic flow chart of step S20 in FIG. 1;
  • step S30 in FIG. 1 is a schematic flow chart of step S30 in FIG. 1;
  • FIG. 4 is a schematic flow chart of another embodiment of a method for decrypting encrypted data by a GStreamer according to the present invention.
  • FIG. 5 is a schematic flowchart of step S50 in FIG. 4;
  • FIG. 6 is a schematic flowchart diagram of still another embodiment of a method for decrypting encrypted data by a GStreamer according to the present invention.
  • FIG. 7 is a schematic structural diagram of an apparatus for decrypting encrypted data by GStreamer according to an embodiment of the present invention.
  • the invention provides a method for decrypting encrypted data by GStreamer, which can be applied to VOD (Video On Demand, video on demand technology) is playing.
  • VOD Video On Demand, video on demand technology
  • FIG. 1 is a schematic flowchart of a method for decrypting encrypted data by GStreamer according to an embodiment of the present invention.
  • the method for decrypting encrypted data by the GStreamer of the present invention comprises the following steps:
  • Step S10 creating an independent data collection module in the pipeline, and integrating the data collection module in the source component;
  • Step S20 collecting encrypted data by a data collection module in the source component, transferring the collected encrypted data to a queue that the source component has created, and pushing the encrypted data to the decryption component;
  • Step S30 decrypting the encrypted data by a decryption component, and pushing the decrypted data to the decoding component;
  • Step S40 Decoding the decrypted data by the decoding component to play the decoded data.
  • the present embodiment collects encrypted data by creating a data collection module in a pipeline, and integrates the data collection module into a source component, thereby collecting encrypted data through the source component.
  • the encrypted data may be collected through the data collection module, for example, collecting streaming media data with DRM encrypted information, and the data source of the streaming media data with DRM encrypted information may be local hard disk data, a network server. , TV data or third party download data.
  • the downloaded encrypted data is pushed to the decryption component by the source component, the received encrypted data is decrypted by the decryption component, and the decrypted data is pushed to the decoding component, and the decrypted data is decoded by the decoding component to play Decoded data.
  • the GStreamer of the present invention decrypts encrypted data, creates an independent data collection module in the pipeline, and integrates the data collection module in the source component to collect the encrypted data, and encrypts the collection of the source component through the decryption component.
  • the data is decrypted, so that the decrypted data can be decoded by the decoding component and then pushed to the corresponding audio decoding plug-in and video decoding plug-in, so that the downloaded encrypted data can be played normally in the pipeline.
  • the decryption of the encrypted data is realized, and the pipeline can ensure that the encrypted data is normally played.
  • FIG. 2 is a schematic flow chart of step S20 of FIG.
  • step S20 includes:
  • Step S21 setting the state of the source component to the processing state, and transmitting the encrypted data containing the uri attribute transmitted from the pipeline to the data collection module, and saving the encrypted data to a temporary buffer through the data collection module;
  • Step S22 Passing the encrypted data in the buffer to the queue of the source element by the callback function
  • Step S23 setting the source pad according to the attribute of the source element, pushing the encrypted data of the callback onto the source pad, and pushing the encrypted data to the decryption element through the source pad.
  • the collected encrypted data is processed by the state of the source element as being processed, and the uri (Uniform Resource) transmitted from the pipeline is included.
  • Identifier universal resource identifier
  • the encrypted data of the attribute is passed to the data collection module, and the data collection module collects the encrypted data according to the data source of the encrypted data (ie, local hard disk data, network server, television data, or third party downloaded data). Save to a temporary buffer.
  • the encrypted data in the buffer can be passed to the queue created by the source component by the callback function.
  • the source pad After passing the encrypted data to the queue in the source element, the source pad is set according to the attributes of the source element, and the encrypted data that is recalled into the queue is pushed onto the source pad, due to the source pad and decryption of the source element
  • the components are connected so that the encrypted data can be pushed to the decryption component through the source pad.
  • the encrypted data of the callback is specifically pushed to the source pad of the created source component by the g_queue_push_tail() function, and the encrypted data is pushed to the buffer on the source pad by the g_queue_pop_head() function, and the source pad is used.
  • the primary role is to stream data to the decryption component, establishing a collection-decryption channel to push the encrypted data in the buffer on the source pad to the decryption component.
  • FIG. 3 is a schematic flowchart of step S30 in FIG.
  • step S30 includes:
  • Step S31 creating a decryption module, integrating the decryption module into the decryption component;
  • Step S32 creating a sink pad and a src pad of the decryption component
  • Step S33 setting an attribute of the decryption element according to a decryption manner of the encrypted data
  • Step S34 copying the encrypted data to the decryption module in the buffer of the sink pad for decryption
  • Step S35 Push the decrypted data to the decoding component in the pipeline according to the decrypted data type.
  • the decryption module is created to decrypt the encrypted data, and at the same time, the sink pad of the decryption component is created to receive the encrypted data of the source pad; the src pad of the decryption component is created to push the decrypted component to the decoding component at the back end of the pipeline.
  • data Register the caps function and the chain function, determine the connected pad through the Caps function, and determine the type of data stream flowing between the pads.
  • the chain function can decrypt the data flowing through the chain function.
  • the attribute of the decryption component is set by the g_object_set() function
  • the encrypted data in the buffer of the sink pad is copied by the chain function to the decryption module for decryption
  • the decrypted data is judged according to the decrypted data.
  • Type respectively, to the video decoding plug-in and audio decoding plug-in in the pipeline to push the decrypted data.
  • the decryption module needs to be encapsulated.
  • the encapsulation process needs to define the instance structure and class structure of the new object in the header file, and the parameters related to decryption are set in the instance structure.
  • the decryption parameters of the decryption module you need to set the properties of the component. This can be done by setting the properties of GObject.
  • the properties of GObject are in _ Defined in the class_init() function.
  • the specific implementation process can modify the pipeline property of the component through the GStreamer system function g_object_set() function.
  • the decryption component can obtain the parameter value set by the application by executing the _set_property() or _get_porterty() function.
  • the sink pad is used to receive the encrypted data passed by the pysrc component. Since the sink pad is set to a permanent pad, the caps negotiation is not performed here. Because the pysrc component is passed with encrypted data, you can directly set the sink pad to a static pad. You can set the GstStaticPadTemplate property value to "applacation/playready". Thus, when the src pad of the pysrc component fluidizes the data, the decryption component can be automatically found, and the decryption component can be connected to the source component. The src pad is responsible for pushing the decrypted data to the downstream decoding component, so there are some differences in setting the src pad.
  • setting the src pad parameter to ANY means that all data can pass, in the plugin_init() function.
  • the pad of the decryption component is set Gst_pad_set_setcaps_function() function;
  • the gst_pad_set_caps() function is then called to set the fixed caps property of the pad, so that the data type flowing through the pad can be controlled to transmit the data to the corresponding video decoding plug-in and audio decoding plug-in respectively.
  • the chain function is bound to the sink pad to ensure that the encrypted data streamed from the pysrc component can be processed directly.
  • the drm_decrypt() function For the encrypted data transmitted from the sink pad, call the drm_decrypt() function to complete the decryption, form the raw data, then determine the decrypted data type, call the caps negotiation, and push the data to the corresponding audio decoding component and video decoding component.
  • the corresponding time stamp may be marked in the data, so that the subsequently connected components can use the time stamp to perform the corresponding audio and video data synchronization processing.
  • FIG. 4 is a schematic flowchart diagram of another embodiment of a method for decrypting encrypted data by GStreamer according to the present invention.
  • the method for decrypting the encrypted data by the GStreamer of the present invention further includes: before step S10:
  • Step S50 Create a source component for collecting and managing encrypted data in the pipeline; wherein the pipeline is a playbin2 pipeline, and the source component is a pysrc component.
  • Playbin2 is a relatively advanced pipeline in GStreamer that automates the loading and linking of components. It automatically assembles a complete conversion chain from input to output based on the type of data stream transformation and the component properties registered in the component list. .
  • a source component for collecting encrypted data is created in the playbin2 pipeline, so that the download and analysis of the streaming media data with drm can be managed by the source component.
  • FIG. 5 is a schematic flow chart of step S50 in FIG.
  • step S50 includes:
  • Step S51 parsing the URL of the identifier source component according to the pysrc protocol, and searching for the pysrc component to be downloaded;
  • Step S52 Modify the uri attribute of the playbin2 pipeline to be an attribute corresponding to the pysrc component
  • Step S53 adding the pysrc component to the pipeline according to the uri attribute through the playbin2 pipeline;
  • Step S54 Modify the attributes of the pysrc component to make it in the ready state
  • Step S55 creating a queue for managing the encrypted data in the pysrc element
  • Step S56 The source pad is set according to the attribute of the pysrc element to push the encrypted data read by the queue onto the source pad.
  • the playback system accesses streaming media data through the URL of the streaming media (Uniform Resource Locator, Uniform Resource Locator), and gstrreamer will find different source components for different protocols, so you need to parse the URL first.
  • URL Uniform Resource Locator
  • gstrreamer will find different source components for different protocols, so you need to parse the URL first.
  • the corresponding function is gst_pysrc_uri_handler_init().
  • the gst_pysrc_uri_handler_init() function registers four functions _get_type () function, _get_protocols () function, _set_uri () and function _get_uri () function, these functions mainly complete the analysis of the URL, get the streaming data type, transport protocol, new pysrc
  • the URL, and the request URI (general resource identifier request) corresponding to the pysrc URL are generated and stored.
  • the generated request when the source component starts The uri is passed to the data collection module, where it is ready to read the data for the pipeline.
  • the URL of the identity source component is parsed according to the pysrc protocol, and by analyzing the URL, the pysrc component that needs to be downloaded can be found.
  • the specific process of modifying the attributes of the pysrc component to make it in the ready state is: outputting the source-setup signal after adding the pysrc component through the playbin2 pipeline; the state rewriting function rewriting the attributes of the pysrc component according to the source-setup signal described above. And set the pysrc component to the ready state, which is the ready state.
  • the buffer of the data collection module is managed by creating a queue queue, and the queue queue is inherited by the Gstreamer base class, so that the external data and the gstreamer can be unified.
  • This embodiment takes the encrypted data on the queue queue by setting the source pad and sends it to the buffer on the source pad. After the pipeline connection is successful, the data can be transferred to the decryption component.
  • the source pad is preferably set as a permanent pad (ie, a static pad), and the GstStaticPadTemplate attribute value can be set to "applacation/playready".
  • the source pad can also be set as a dynamic pad according to actual needs, which is not limited herein.
  • FIG. 6 is a schematic flowchart diagram of still another embodiment of a method for decrypting encrypted data by GStreamer according to the present invention.
  • the method for decrypting the encrypted data by the GStreamer of the present invention further includes:
  • Step S60 Creating a decryption element and a decoding element in the pipeline.
  • the encrypted data is decrypted by creating a decryption component in the pipeline, thereby enabling decryption of the streaming media data containing the encrypted information, and ensuring normal playback of the streaming media data.
  • the present invention also provides an apparatus for GStreamer to decrypt encrypted data.
  • FIG. 7 is a schematic structural diagram of an apparatus for decrypting encrypted data by GStreamer according to an embodiment of the present invention.
  • the device for decrypting encrypted data by the GStreamer includes:
  • a component creation module 100 configured to create an independent data collection module in the pipeline, and the data collection module is in the source component;
  • a data downloading module 200 configured to encrypt data collected by a source component, and push the encrypted data to a decryption component;
  • the data decryption module 300 is configured to decrypt the encrypted data by using a decryption component, and push the decrypted data to the decoding component;
  • the data decoding module 400 is configured to decode the decrypted data by the decoding component to play the decoded data.
  • the component creation module 100 creates an independent data collection module in the pipeline, the data collection module being in the source component to collect the encrypted data by the source component.
  • the data download module 200 collects encrypted data by using a data collection module of the source component, for example, collecting streaming media data with DRM encrypted information, and the data source of the streaming media data with DRM encrypted information may be local hard disk data, network server, television data, or Three parties download the data.
  • the data downloading module 200 pushes the downloaded encrypted data to the decryption component through the source component, the data decryption module 300 decrypts the received encrypted data through the decryption component, and pushes the decrypted data to the decoding component, and the data decoding module 400 passes The decoding component decodes the decrypted data to play the decoded data.
  • the GStreamer of the present invention decrypts encrypted data, creates an independent data collection module in the pipeline, and integrates the data collection module in the source component to collect the encrypted data and encrypt the source component through the decryption component.
  • the data is decrypted, so that the decrypted data can be decoded by the decoding component and then pushed to the corresponding audio decoding plug-in and video decoding plug-in, so that the downloaded encrypted data can be played normally in the pipeline.
  • the decryption of the encrypted data is realized, and the pipeline can ensure that the encrypted data is normally played.
  • the data download module 200 is specifically configured to:
  • the source pad is set according to the attributes of the source element, and the encrypted data from the callback is pushed onto the source pad, and the encrypted data is pushed to the decryption element by the source pad.
  • the collected encrypted data is processed by the state of the source element as being processed, and the uri (Uniform Resource) transmitted from the pipeline is included.
  • Identifier universal resource identifier
  • the encrypted data of the attribute is passed to the data collection module, and the data collection module collects the encrypted data according to the data source of the encrypted data (ie, local hard disk data, network server, television data, or third party downloaded data). Save to a temporary buffer.
  • the encrypted data in the buffer can be passed to the queue created by the source component by the callback function.
  • the source pad After passing the encrypted data to the queue in the source element, the source pad is set according to the attributes of the source element, and the encrypted data that is recalled into the queue is pushed onto the source pad, due to the source pad and decryption of the source element
  • the components are connected so that the encrypted data can be pushed to the decryption component through the source pad.
  • the encrypted data of the callback is specifically pushed to the source pad of the created source component by the g_queue_push_tail() function, and the encrypted data is pushed to the buffer on the source pad by the g_queue_pop_head() function, and the source pad is used.
  • the primary role is to stream data to the decryption component, establishing a collection-decryption channel to push the encrypted data in the buffer on the source pad to the decryption component.
  • the data decryption module 300 is specifically configured to:
  • the decrypted data is pushed to the decoding component in the pipeline according to the decrypted data type.
  • the decryption module is created to decrypt the encrypted data, and at the same time, the sink pad of the decryption component is created to receive the encrypted data of the source pad; the src pad of the decryption component is created to push the decrypted component to the decoding component at the back end of the pipeline.
  • data Register the caps function and the chain function, determine the connected pad through the Caps function, and determine the type of data stream flowing between the pads.
  • the chain function can decrypt the data flowing through the chain function.
  • the attribute of the decryption component is set by the g_object_set() function
  • the encrypted data in the buffer of the sink pad is copied by the chain function to the decryption module for decryption
  • the decrypted data is judged according to the decrypted data.
  • Type respectively, to the video decoding plug-in and audio decoding plug-in in the pipeline to push the decrypted data.
  • the decryption module needs to be encapsulated.
  • the encapsulation process needs to define the instance structure and class structure of the new object in the header file, and the parameters related to decryption are set in the instance structure.
  • the decryption parameters of the decryption module you need to set the properties of the component. This can be done by setting the properties of GObject.
  • the properties of GObject are in _ Defined in the class_init() function.
  • the specific implementation process can modify the pipeline property of the component through the GStreamer system function g_object_set() function.
  • the decryption component can obtain the parameter value set by the application by executing the _set_property() or _get_porterty() function.
  • the sink pad is used to receive the encrypted data passed by the pysrc component. Since the sink pad is set to a permanent pad, the caps negotiation is not performed here. Because the pysrc component is passed with encrypted data, you can directly set the sink pad to a static pad. You can set the GstStaticPadTemplate property value to "applacation/playready". Thus, when the src pad of the pysrc component fluidizes the data, the decryption component can be automatically found, and the decryption component can be connected to the source component. The src pad is responsible for pushing the decrypted data to the downstream decoding component, so there are some differences in setting the src pad.
  • setting the src pad parameter to ANY means that all data can pass, in the plugin_init() function.
  • the pad of the decryption component is set Gst_pad_set_setcaps_function() function;
  • the gst_pad_set_caps() function is then called to set the fixed caps property of the pad, so that the data type flowing through the pad can be controlled to transmit the data to the corresponding video decoding plug-in and audio decoding plug-in respectively.
  • the chain function is bound to the sink pad to ensure that the encrypted data streamed from the pysrc component can be processed directly.
  • the drm_decrypt() function For the encrypted data transmitted from the sink pad, call the drm_decrypt() function to complete the decryption, form the raw data, then determine the decrypted data type, call the caps negotiation, and push the data to the corresponding audio decoding component and video decoding component.
  • the corresponding time stamp may be marked in the data, so that the subsequently connected components can use the time stamp to perform the corresponding audio and video data synchronization processing.
  • the component creation module 100 is further configured to create a source component for collecting and managing encrypted data in the pipeline; wherein the pipeline is a playbin2 pipeline, and the source component is a pysrc component.
  • Playbin2 is a relatively advanced pipeline in GStreamer that automates the loading and linking of components. It automatically assembles a complete conversion chain from input to output based on the type of data stream transformation and the component properties registered in the component list. .
  • a source component for collecting encrypted data is created in the playbin2 pipeline, so that the download and analysis of the streaming media data with drm can be managed by the source component.
  • the source component for creating and managing encrypted data in the pipeline by the component creation module 100 is specifically:
  • the source pad is set according to the attributes of the pysrc element to push the encrypted data read by the queue onto the source pad.
  • the playback system accesses streaming media data through the URL of the streaming media (Uniform Resource Locator, Uniform Resource Locator), and gstrreamer will find different source components for different protocols, so you need to parse the URL first.
  • URL Uniform Resource Locator
  • gstrreamer will find different source components for different protocols, so you need to parse the URL first.
  • the corresponding function is gst_pysrc_uri_handler_init().
  • the gst_pysrc_uri_handler_init() function registers four functions _get_type () function, _get_protocols () function, _set_uri () and function _get_uri () function, these functions mainly complete the analysis of the URL, get the streaming data type, transport protocol, new pysrc
  • the URL, and the request URI (general resource identifier request) corresponding to the pysrc URL are generated and stored.
  • the generated request when the source component starts The uri is passed to the data collection module, where it is ready to read the data for the pipeline.
  • the URL of the identity source component is parsed according to the pysrc protocol, and by analyzing the URL, the pysrc component that needs to be downloaded can be found.
  • the specific process of modifying the attributes of the pysrc component to make it in the ready state is: outputting the source-setup signal after adding the pysrc component through the playbin2 pipeline; the state rewriting function rewriting the attributes of the pysrc component according to the source-setup signal described above. And set the pysrc component to the ready state, which is the ready state.
  • the buffer of the data collection module is managed by creating a queue queue, and the queue queue is inherited by the Gstreamer base class, so that the external data and the gstreamer can be unified.
  • This embodiment takes the encrypted data on the queue queue by setting the source pad and sends it to the buffer on the source pad. After the pipeline connection is successful, the data can be transferred to the decryption component.
  • the source pad is preferably set as a permanent pad (ie, a static pad), and the GstStaticPadTemplate attribute value can be set to "applacation/playready".
  • the source pad can also be set as a dynamic pad according to actual needs, which is not limited herein.
  • the component creation module 100 is further configured to create a decryption component and a decoding component in a pipeline.
  • the component creation module 100 creates a decryption component in the pipeline to decrypt the encrypted data, thereby enabling decryption of the streaming media data containing the encrypted information, and ensuring normal playback of the streaming media data.

Abstract

A method for encrypting and decrypting data by Gstreamer is disclosed in the present invention. The method includes the following steps of: creating an independent data collection module in a pipeline, integrating the data collection module into a source element, collecting encrypted data by the data collection module, transferring the collected encrypted data to a queue of the source element, and pushing the encrypted data to a decryption element; decrypting the encrypted data by the decryption element, and pushing the decrypted data to a decoding element; and decoding the decrypted data by the decoding element to play the decoded data. A device for encrypting and decrypting data by Gstreamer is also disclosed in the present invention, wherein the device is corresponding to the method. According to the present invention, the downloaded encrypted data can be properly played in the pipeline, decrypting the encrypted data is realized, and properly playing the encrypted data in the pipeline can be ensured.

Description

GStreamer解密加密数据的方法及装置  Method and device for decrypting encrypted data by GStreamer
技术领域Technical field
本发明涉及流媒体数据处理技术领域,尤其涉及一种GStreamer解密加密数据的方法及装置。The present invention relates to the field of streaming media data processing technologies, and in particular, to a GStreamer method and apparatus for decrypting encrypted data.
背景技术Background technique
GStreamer是一种开源的流媒体框架,GStreamer是基于插件的,其中有些插件中提供了各种各样的多媒体数字信号编解码器,也有些插件提供了其他的功能,所有的插件都能够被链接到任意的已经定义了的数据流管道中。GStreamer is an open source streaming media framework. GStreamer is based on plugins. Some of the plugins provide a variety of multimedia digital codecs, and some plugins provide other functions. All plugins can be linked. Go to any of the defined data flow pipelines.
目前的GStreamer插件中源插件基本上涵盖了各种文件格式,例如,单音频的数据wma,管道(pipeline)中主要用到的元件(即插件)是source元件(即源元件)、demux元件(即多路分配器元件)、decode元件(即解码元件)、converter元件(即转换器元件)以及sink元件(即接收器元件),它们构建成一个管道完成数据的处理,Source元件是负责为管道读取数据的源元件,demux元件负责对数据进行初步的处理分流,通过缓存元件送到相应的音视频解码器对媒体数据进行解码。decode元件完成解码功能,形成YUV分量数据,converter元件完成进一步的转换的过滤,最后通过sink元件分别将视频和音频播放到屏幕和声卡端。The source plug-ins in the current GStreamer plug-in basically cover various file formats, for example, single-audio data wma, the main components used in the pipeline (ie plug-ins) are source components (ie source components), demux components ( That is, the demultiplexer component), the decode component (ie, the decoding component), the converter component (ie, the converter component), and the sink component (ie, the receiver component), which are constructed as a pipeline to complete the processing of the data, and the Source component is responsible for the pipeline. The source component of the read data, the demux component is responsible for preliminary processing and shunting of the data, and the buffer component is sent to the corresponding audio and video decoder to decode the media data. The decode component completes the decoding function, forms the YUV component data, the converter component performs the further conversion filtering, and finally plays the video and audio to the screen and the sound card end respectively through the sink component.
综上所述,虽然管道的创建流程很方便,但目前GStreamer实现的插件都是针对清流文件的,而对于加密数据,如带DRM(Data Rights Management,数字版权管理)加密信息的流媒体数据,却没有对应的插件来实现加密数据的解密过程,而导致管道播放加密数据失败。In summary, although the pipeline creation process is very convenient, the plug-ins implemented by GStreamer are currently for clearing files, and for encrypted data, such as with DRM (Data Rights) Management, digital rights management) Streaming media data of encrypted information, but there is no corresponding plug-in to achieve the decryption process of encrypted data, which causes the pipeline to play encrypted data failed.
发明内容Summary of the invention
本发明的主要目的在于提供一种GStreamer解密加密数据的方法及装置,旨在实现对加密数据进行解密,确保管道正常播放加密数据。The main object of the present invention is to provide a method and device for decrypting encrypted data by GStreamer, aiming at decrypting encrypted data and ensuring that the pipeline plays encrypted data normally.
为了达到上述目的,本发明提供一种GStreamer解密加密数据的方法,所述GStreamer解密加密数据的方法包括以下步骤:In order to achieve the above object, the present invention provides a method for GStreamer to decrypt encrypted data, and the method for decrypting encrypted data by the GStreamer includes the following steps:
在管道中创建独立的数据收集模块,将所述数据收集模块集成在源元件中;Creating a separate data collection module in the pipeline, integrating the data collection module in the source component;
通过源元件中的数据收集模块收集加密数据,将所收集的加密数据传递到源元件已创建的队列中,并将所述加密数据推送到解密元件;Collecting encrypted data through a data collection module in the source component, passing the collected encrypted data to a queue that the source component has created, and pushing the encrypted data to the decryption component;
通过解密元件对所述加密数据进行解密,并将解密后的数据推送到解码元件;Decrypting the encrypted data by a decryption component and pushing the decrypted data to a decoding component;
通过解码元件对解密后的数据进行解码,以播放解码后的数据。The decrypted data is decoded by the decoding component to play the decoded data.
优选地,所述通过源元件中的数据收集模块收集加密数据,将所收集的加密数据传递到源元件已创建的队列中,并将所述加密数据推送到解密元件的步骤包括:Preferably, the step of collecting the encrypted data by the data collection module in the source component, transferring the collected encrypted data to a queue that the source component has created, and pushing the encrypted data to the decryption component comprises:
设置所述源元件的状态为正在处理状态,将从管道传输过来的含有uri属性的加密数据传递给数据收集模块,通过数据收集模块将所述加密数据保存到一临时缓冲区中;Setting the state of the source component to a processing state, and transmitting the encrypted data containing the uri attribute transmitted from the pipeline to the data collection module, and saving the encrypted data to a temporary buffer through the data collection module;
由回调函数将缓冲区中的加密数据传递到源元件的队列中;Passing the encrypted data in the buffer to the queue of the source component by the callback function;
根据源元件的属性设置源衬垫,将回调上来的加密数据推送到所述源衬垫上,通过所述源衬垫将加密数据推送到解密元件。The source pad is set according to the attributes of the source element, and the encrypted data from the callback is pushed onto the source pad, and the encrypted data is pushed to the decryption element by the source pad.
优选地,所述通过解密元件对所述加密数据进行解密,并将解密后的数据推送到解码元件的步骤包括:Preferably, the step of decrypting the encrypted data by the decryption component and pushing the decrypted data to the decoding component comprises:
创建解密模块,将所述解密模块集成到所述解密元件;Creating a decryption module, integrating the decryption module into the decryption component;
创建解密元件的sink衬垫和src衬垫;Creating a sink pad and a src pad for the decryption component;
根据加密数据的解密方式设置解密元件的属性;Setting the attribute of the decryption element according to the decryption manner of the encrypted data;
在sink衬垫的缓冲区中将加密数据拷贝到解密模块进行解密;Copying the encrypted data to the decryption module for decryption in the buffer of the sink pad;
根据解密后的数据类型,向管道中的解码元件推送解密后的数据。The decrypted data is pushed to the decoding component in the pipeline according to the decrypted data type.
优选地,所述GStreamer解密加密数据的方法还包括:Preferably, the method for decrypting the encrypted data by the GStreamer further includes:
在管道中创建用于收集和管理加密数据的源元件;所述管道为playbin2管道,所述源元件为pysrc元件;Creating a source element for collecting and managing encrypted data in a pipeline; the pipeline is a playbin2 pipeline, and the source component is a pysrc component;
所述在管道中创建用于收集和管理加密数据的源元件的步骤包括:The steps of creating a source component for collecting and managing encrypted data in the pipeline include:
根据pysrc协议解析标识源元件的URL,查找需要下载的pysrc元件;Parsing the URL of the identity source component according to the pysrc protocol, and finding the pysrc component that needs to be downloaded;
修改playbin2管道的uri属性为所述pysrc元件所对应的属性;Modifying the uri attribute of the playbin2 pipeline to the attribute corresponding to the pysrc component;
通过playbin2管道根据uri属性将所述pysrc元件添加到管道中;Adding the pysrc component to the pipeline according to the uri attribute through the playbin2 pipeline;
修改pysrc元件的属性以使其处于就绪状态;Modify the properties of the pysrc component to make it ready;
在pysrc元件中创建用于管理所述加密数据的队列;Creating a queue for managing the encrypted data in the pysrc element;
根据pysrc元件的属性设置源衬垫,以将所述队列读取到的加密数据推送到源衬垫上。The source pad is set according to the attributes of the pysrc element to push the encrypted data read by the queue onto the source pad.
优选地,所述GStreamer解密加密数据的方法还包括:Preferably, the method for decrypting the encrypted data by the GStreamer further includes:
在管道中创建解密元件和解码元件。A decryption element and a decoding element are created in the pipeline.
此外,为了达到上述目的,本发明还提供一种GStreamer解密加密数据的装置,所述GStreamer解密加密数据的装置包括:In addition, in order to achieve the above object, the present invention further provides an apparatus for decrypting encrypted data by a GStreamer, where the apparatus for decrypting encrypted data by the GStreamer includes:
元件创建模块,用于在管道中创建独立的数据收集模块,将所述数据收集模块在源元件中;a component creation module, configured to create an independent data collection module in the pipeline, and the data collection module is in the source component;
数据下载模块,用于通过源元件中的数据收集模块收集加密数据,将所收集的加密数据传递到源元件已创建的队列中,并将所述加密数据推送到解密元件;a data downloading module, configured to collect encrypted data by using a data collection module in the source component, transfer the collected encrypted data to a queue that the source component has created, and push the encrypted data to the decryption component;
数据解密模块,用于通过解密元件对所述加密数据进行解密,并将解密后的数据推送到解码元件;a data decryption module, configured to decrypt the encrypted data by a decryption component, and push the decrypted data to a decoding component;
数据解码模块,用于通过解码元件对解密后的数据进行解码,以播放解码后的数据。The data decoding module is configured to decode the decrypted data by the decoding component to play the decoded data.
优选地,所述数据下载模块具体用于:Preferably, the data download module is specifically configured to:
设置所述源元件的状态为正在处理状态,将从管道传输过来的含有uri属性的加密数据传递给数据收集模块,通过数据收集模块将所述加密数据保存到一临时缓冲区中;Setting the state of the source component to a processing state, and transmitting the encrypted data containing the uri attribute transmitted from the pipeline to the data collection module, and saving the encrypted data to a temporary buffer through the data collection module;
由回调函数将缓冲区中的加密数据传递到源元件的队列中;Passing the encrypted data in the buffer to the queue of the source component by the callback function;
根据源元件的属性设置源衬垫,将回调上来的加密数据推送到所述源衬垫上,通过所述源衬垫将加密数据推送到解密元件。The source pad is set according to the attributes of the source element, and the encrypted data from the callback is pushed onto the source pad, and the encrypted data is pushed to the decryption element by the source pad.
优选地,所述数据解密模块具体用于:Preferably, the data decryption module is specifically configured to:
创建解密模块,将所述解密模块集成到所述解密元件;Creating a decryption module, integrating the decryption module into the decryption component;
创建解密元件的sink衬垫和src衬垫;Creating a sink pad and a src pad for the decryption component;
根据加密数据的解密方式设置解密元件的属性;Setting the attribute of the decryption element according to the decryption manner of the encrypted data;
在sink衬垫的缓冲区中将加密数据拷贝到解密模块进行解密;Copying the encrypted data to the decryption module for decryption in the buffer of the sink pad;
根据解密后的数据类型,向管道中的解码元件推送解密后的数据。The decrypted data is pushed to the decoding component in the pipeline according to the decrypted data type.
优选地,所述元件创建模块还用于在管道中创建用于收集和管理加密数据的源元件;所述管道为playbin2管道,所述源元件为pysrc元件;Preferably, the component creation module is further configured to create a source component for collecting and managing encrypted data in a pipeline; the pipeline is a playbin2 pipeline, and the source component is a pysrc component;
所述元件创建模块在管道中创建用于收集和管理加密数据的源元件具体为:The component creation module creates a source component in the pipeline for collecting and managing encrypted data, specifically:
根据pysrc协议解析标识源元件的URL,查找需要下载的pysrc元件;Parsing the URL of the identity source component according to the pysrc protocol, and finding the pysrc component that needs to be downloaded;
修改playbin2管道的uri属性为所述pysrc元件所对应的属性;Modifying the uri attribute of the playbin2 pipeline to the attribute corresponding to the pysrc component;
通过playbin2管道根据uri属性将所述pysrc元件添加到管道中;Adding the pysrc component to the pipeline according to the uri attribute through the playbin2 pipeline;
修改pysrc元件的属性以使其处于就绪状态;Modify the properties of the pysrc component to make it ready;
在pysrc元件中创建用于管理所述加密数据的队列;Creating a queue for managing the encrypted data in the pysrc element;
根据pysrc元件的属性设置源衬垫,以将所述队列读取到的加密数据推送到源衬垫上。The source pad is set according to the attributes of the pysrc element to push the encrypted data read by the queue onto the source pad.
优选地,所述元件创建模块还用于在管道中创建解密元件和解码元件。Preferably, the component creation module is further configured to create a decryption component and a decoding component in the pipeline.
本发明提供的GStreamer解密加密数据的方法及装置,在管道中创建独立的数据收集模块,将该数据收集模块集成在源元件中,通过该数据收集模块收集加密数据,将所收集的加密数据传递到源元件已创建的队列中,并将所述加密数据推送到解密元件,通过解密元件对所述加密数据进行解密,并将解密后的数据推送到解码元件,从而使得解密后的数据能够经过解码元件解码后推送到对应的音频解码插件和视频解码插件,使得下载的加密数据能够正常的在管道中播放。从而实现了对加密数据(如带DRM加密信息的流媒体数据)进行解密,能够确保管道正常播放加密数据。The method and device for decrypting encrypted data by the GStreamer provided by the invention create an independent data collection module in the pipeline, integrate the data collection module in the source component, collect the encrypted data through the data collection module, and transmit the collected encrypted data. Going to the queue in which the source component has been created, and pushing the encrypted data to the decryption component, decrypting the encrypted data by the decryption component, and pushing the decrypted data to the decoding component, so that the decrypted data can pass through After decoding, the decoding component is pushed to the corresponding audio decoding plug-in and video decoding plug-in, so that the downloaded encrypted data can be played normally in the pipeline. Thereby, the encrypted data (such as streaming media data with DRM encrypted information) is decrypted, and the pipeline can ensure that the encrypted data is played normally.
附图说明DRAWINGS
图1为本发明GStreamer解密加密数据的方法一实施例的流程示意图;1 is a schematic flowchart of a method for decrypting encrypted data by GStreamer according to an embodiment of the present invention;
图2为图1中步骤S20的流程示意图;2 is a schematic flow chart of step S20 in FIG. 1;
图3为图1中步骤S30的流程示意图;3 is a schematic flow chart of step S30 in FIG. 1;
图4为本发明GStreamer解密加密数据的方法另一实施例的流程示意图;4 is a schematic flow chart of another embodiment of a method for decrypting encrypted data by a GStreamer according to the present invention;
图5为图4中步骤S50的流程示意图;FIG. 5 is a schematic flowchart of step S50 in FIG. 4;
图6为本发明GStreamer解密加密数据的方法又一实施例的流程示意图;6 is a schematic flowchart diagram of still another embodiment of a method for decrypting encrypted data by a GStreamer according to the present invention;
图7为本发明GStreamer解密加密数据的装置一实施例的结构示意图。FIG. 7 is a schematic structural diagram of an apparatus for decrypting encrypted data by GStreamer according to an embodiment of the present invention.
本发明的目的、功能特点及优点的实现,将结合实施例,并参照附图作进一步说明。The objectives, functional features, and advantages of the present invention will be described in conjunction with the embodiments of the invention.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明提供一种GStreamer解密加密数据的方法,该方法可应用于VOD(Video On Demand,视频点播技术)播放中。The invention provides a method for decrypting encrypted data by GStreamer, which can be applied to VOD (Video On Demand, video on demand technology) is playing.
参照图1,图1为本发明GStreamer解密加密数据的方法一实施例的流程示意图。Referring to FIG. 1, FIG. 1 is a schematic flowchart of a method for decrypting encrypted data by GStreamer according to an embodiment of the present invention.
本发明第一实施例中,本发明GStreamer解密加密数据的方法包括以下步骤:In the first embodiment of the present invention, the method for decrypting encrypted data by the GStreamer of the present invention comprises the following steps:
步骤S10:在管道中创建独立的数据收集模块,将所述数据收集模块集成在源元件中;Step S10: creating an independent data collection module in the pipeline, and integrating the data collection module in the source component;
步骤S20:通过源元件中的数据收集模块收集加密数据,将所收集的加密数据传递到源元件已创建的队列中,并将所述加密数据推送到解密元件;Step S20: collecting encrypted data by a data collection module in the source component, transferring the collected encrypted data to a queue that the source component has created, and pushing the encrypted data to the decryption component;
步骤S30:通过解密元件对所述加密数据进行解密,并将解密后的数据推送到解码元件;Step S30: decrypting the encrypted data by a decryption component, and pushing the decrypted data to the decoding component;
步骤S40:通过解码元件对解密后的数据进行解码,以播放解码后的数据。Step S40: Decoding the decrypted data by the decoding component to play the decoded data.
在本实施例中,本实施例通过在管道中创建数据收集模块来收集加密数据,将所述数据收集模块集成到源元件中,从而通过源元件收集加密数据。在将数据收集模块在源元件中之后,可通过数据收集模块收集加密数据,例如收集带DRM加密信息的流媒体数据,带DRM加密信息的流媒体数据的数据来源可以为本地硬盘数据、网络服务器、电视数据或第三方下载数据。通过源元件将所下载的加密数据推送到解密元件,通过解密元件对接收到的加密数据进行解密,并将解密后的数据推送到解码元件,通过解码元件对解密后的数据进行解码,以播放解码后的数据。In the present embodiment, the present embodiment collects encrypted data by creating a data collection module in a pipeline, and integrates the data collection module into a source component, thereby collecting encrypted data through the source component. After the data collection module is in the source component, the encrypted data may be collected through the data collection module, for example, collecting streaming media data with DRM encrypted information, and the data source of the streaming media data with DRM encrypted information may be local hard disk data, a network server. , TV data or third party download data. The downloaded encrypted data is pushed to the decryption component by the source component, the received encrypted data is decrypted by the decryption component, and the decrypted data is pushed to the decoding component, and the decrypted data is decoded by the decoding component to play Decoded data.
相对于现有技术,本发明GStreamer解密加密数据的方法,在管道中创建独立的数据收集模块,并将数据收集模块集成在源元件中,以收集加密数据,通过解密元件对源元件收集的加密数据进行解密,使得解密后的数据能够经过解码元件解码后推送到对应的音频解码插件和视频解码插件,使得下载的加密数据能够正常在管道中播放。从而实现了对加密数据进行解密,能够确保管道正常播放加密数据。Compared with the prior art, the GStreamer of the present invention decrypts encrypted data, creates an independent data collection module in the pipeline, and integrates the data collection module in the source component to collect the encrypted data, and encrypts the collection of the source component through the decryption component. The data is decrypted, so that the decrypted data can be decoded by the decoding component and then pushed to the corresponding audio decoding plug-in and video decoding plug-in, so that the downloaded encrypted data can be played normally in the pipeline. Thereby, the decryption of the encrypted data is realized, and the pipeline can ensure that the encrypted data is normally played.
再参照图2,图2为图1中步骤S20的流程示意图。Referring again to FIG. 2, FIG. 2 is a schematic flow chart of step S20 of FIG.
基于上述第一实施例,本发明第二实施例中,步骤S20包括:Based on the foregoing first embodiment, in the second embodiment of the present invention, step S20 includes:
步骤S21:设置所述源元件的状态为正在处理状态,将从管道传输过来的含有uri属性的加密数据传递给数据收集模块,通过数据收集模块将所述加密数据保存到一临时缓冲区中;Step S21: setting the state of the source component to the processing state, and transmitting the encrypted data containing the uri attribute transmitted from the pipeline to the data collection module, and saving the encrypted data to a temporary buffer through the data collection module;
步骤S22:由回调函数将缓冲区中的加密数据传递到源元件的队列中;Step S22: Passing the encrypted data in the buffer to the queue of the source element by the callback function;
步骤S23:根据源元件的属性设置源衬垫,将回调上来的加密数据推送到所述源衬垫上,通过所述源衬垫将加密数据推送到解密元件。Step S23: setting the source pad according to the attribute of the source element, pushing the encrypted data of the callback onto the source pad, and pushing the encrypted data to the decryption element through the source pad.
本实施例通过将源元件的状态为正在处理状态,以对收集的加密数据进行处理,并将从管道传输过来的含有uri(Uniform Resource Identifier,通用资源标识符)属性的加密数据传递给数据收集模块,数据收集模块具体根据加密数据的数据来源(即本地硬盘数据、网络服务器、电视数据或第三方下载数据),将收集的加密数据保存到一临时缓冲区中。In this embodiment, the collected encrypted data is processed by the state of the source element as being processed, and the uri (Uniform Resource) transmitted from the pipeline is included. Identifier, universal resource identifier) The encrypted data of the attribute is passed to the data collection module, and the data collection module collects the encrypted data according to the data source of the encrypted data (ie, local hard disk data, network server, television data, or third party downloaded data). Save to a temporary buffer.
在数据收集模块保存收集到的加密数据后,可由回调函数将缓冲区中的加密数据传递到源元件已创建好的队列中。After the data collection module saves the collected encrypted data, the encrypted data in the buffer can be passed to the queue created by the source component by the callback function.
在将加密数据传递到源元件中的队列后,根据源元件的属性设置源衬垫,并将回调到队列中的加密数据推送到所述源衬垫上,由于源元件的源衬垫与解密元件连接,从而可通过源衬垫将加密数据推送到解密元件。After passing the encrypted data to the queue in the source element, the source pad is set according to the attributes of the source element, and the encrypted data that is recalled into the queue is pushed onto the source pad, due to the source pad and decryption of the source element The components are connected so that the encrypted data can be pushed to the decryption component through the source pad.
本实施例具体将回调上来的加密数据通过g_queue_push_tail()函数推送到已创建好的源元件的源衬垫上,通过g_queue_pop_head()函数将加密数据推送到源衬垫上的缓冲区,源衬垫主要作用是向解密元件流化数据,建立收集-解密通道,从而将源衬垫上的缓冲区中的加密数据推送到解密元件。In this embodiment, the encrypted data of the callback is specifically pushed to the source pad of the created source component by the g_queue_push_tail() function, and the encrypted data is pushed to the buffer on the source pad by the g_queue_pop_head() function, and the source pad is used. The primary role is to stream data to the decryption component, establishing a collection-decryption channel to push the encrypted data in the buffer on the source pad to the decryption component.
再参照图3,图3为图1中步骤S30的流程示意图。Referring again to FIG. 3, FIG. 3 is a schematic flowchart of step S30 in FIG.
基于上述第一实施例,本发明第三实施例中,步骤S30包括:Based on the foregoing first embodiment, in the third embodiment of the present invention, step S30 includes:
步骤S31:创建解密模块,将所述解密模块集成到所述解密元件;Step S31: creating a decryption module, integrating the decryption module into the decryption component;
步骤S32:创建解密元件的sink衬垫和src衬垫;Step S32: creating a sink pad and a src pad of the decryption component;
步骤S33:根据加密数据的解密方式设置解密元件的属性;Step S33: setting an attribute of the decryption element according to a decryption manner of the encrypted data;
步骤S34:在sink衬垫的缓冲区中将加密数据拷贝到解密模块进行解密;Step S34: copying the encrypted data to the decryption module in the buffer of the sink pad for decryption;
步骤S35:根据解密后的数据类型,向管道中的解码元件推送解密后的数据。Step S35: Push the decrypted data to the decoding component in the pipeline according to the decrypted data type.
本实施例通过创建解密模块来解密加密数据,同时,创建解密元件的sink衬垫,以接收源衬垫的加密数据;创建解密元件的src衬垫,以向管道后端的解码元件推送解密后的数据。注册caps函数和和chain函数,通过Caps函数决定相连接的衬垫,并决定流经衬垫之间的数据流的类型,通过chain函数可以对流经的数据进行解密处理。从而根据加密数据的解密方式通过g_object_set()函数设置解密元件的属性,通过chain函数拷贝sink衬垫的缓冲区中的加密数据到解密模块进行解密,根据解密后的数据,判断解密得到的数据的类型,分别向管道中的视频解码插件和音频解码插件推送解密后的数据。In this embodiment, the decryption module is created to decrypt the encrypted data, and at the same time, the sink pad of the decryption component is created to receive the encrypted data of the source pad; the src pad of the decryption component is created to push the decrypted component to the decoding component at the back end of the pipeline. data. Register the caps function and the chain function, determine the connected pad through the Caps function, and determine the type of data stream flowing between the pads. The chain function can decrypt the data flowing through the chain function. Therefore, according to the decryption mode of the encrypted data, the attribute of the decryption component is set by the g_object_set() function, the encrypted data in the buffer of the sink pad is copied by the chain function to the decryption module for decryption, and the decrypted data is judged according to the decrypted data. Type, respectively, to the video decoding plug-in and audio decoding plug-in in the pipeline to push the decrypted data.
加密的流媒体数据被处理的过程中,流媒体数据流经pysrc元件后,无论是音频还是视频数据都必然要进行解密处理,才可以被解码元件进行解码处理,据此,需要封装解密模块,封装过程需要在头文件定义新对象的实例结构和类结构,解密相关的参数都设置在实例结构体内。In the process of processing the encrypted streaming media data, after the streaming media data flows through the pysrc component, both the audio and the video data must be decrypted before being decoded by the decoding component. Accordingly, the decryption module needs to be encapsulated. The encapsulation process needs to define the instance structure and class structure of the new object in the header file, and the parameters related to decryption are set in the instance structure.
根据解密模块的解密参数需要,需要设置元件的属性,这可通过设置GObject的属性完成,GObject的属性在_ class_init()函数中定义。具体的实施过程可以通过GStreamer的系统函数g_object_set()函数对元件的管道属性进行修改,解密元件内部可通过执行_set_property()或_get_porterty()函数,来获得应用设置好的参数值。According to the decryption parameters of the decryption module, you need to set the properties of the component. This can be done by setting the properties of GObject. The properties of GObject are in _ Defined in the class_init() function. The specific implementation process can modify the pipeline property of the component through the GStreamer system function g_object_set() function. The decryption component can obtain the parameter value set by the application by executing the _set_property() or _get_porterty() function.
sink衬垫用于接收pysrc元件传递过来的加密数据,由于本实施将sink衬垫设置成永久的衬垫,因此这里不进行caps协商。因为pysrc元件传递过来的还是带加密的数据,可以直接将sink衬垫设置成静态衬垫,具体可将设置GstStaticPadTemplate属性值为“applacation/playready”。从而当pysrc元件的src衬垫流化数据时,就能够自动找到解密元件,进而解密元件与源元件可以连接起来。而src衬垫负责的是将解密后的数据往下游的解码元件推送,所以设置src衬垫有一些差别,这里设置src衬垫参数为ANY,即表示所有数据都能够通过,在plugin_init()函数中注册sink衬垫和src衬垫,完成解密元件衬垫的设置。解密元件的衬垫创建完成后,要设置 gst_pad_set_setcaps_function()函数; 随后调用gst_pad_set_caps()函数来设置衬垫的固定caps属性,从而可以控制流经衬垫的数据类型,将数据分别传输到对应的视频解码插件和音频解码插件。The sink pad is used to receive the encrypted data passed by the pysrc component. Since the sink pad is set to a permanent pad, the caps negotiation is not performed here. Because the pysrc component is passed with encrypted data, you can directly set the sink pad to a static pad. You can set the GstStaticPadTemplate property value to "applacation/playready". Thus, when the src pad of the pysrc component fluidizes the data, the decryption component can be automatically found, and the decryption component can be connected to the source component. The src pad is responsible for pushing the decrypted data to the downstream decoding component, so there are some differences in setting the src pad. Here, setting the src pad parameter to ANY means that all data can pass, in the plugin_init() function. Register the sink pad and the src pad to complete the setting of the decryption component pad. After the pad of the decryption component is created, it is set Gst_pad_set_setcaps_function() function; The gst_pad_set_caps() function is then called to set the fixed caps property of the pad, so that the data type flowing through the pad can be controlled to transmit the data to the corresponding video decoding plug-in and audio decoding plug-in respectively.
在本实施例中,chain函数绑定在sink衬垫,确保从pysrc元件流化过来的加密数据能够直接进行处理。对于从sink衬垫传输进来的加密数据,调用drm_decrypt()函数完成解密,形成raw数据,然后判断解密后的数据类型,调用caps协商,将数据推送到对应的音频解码元件和视频解码元件,在加密数据的传递过程中,为了使得处理的音视频数据同步,可以在数据标记相应的时间戳,从而后续连接的元件可以利用时间戳进行相应的音视频数据同步处理。In this embodiment, the chain function is bound to the sink pad to ensure that the encrypted data streamed from the pysrc component can be processed directly. For the encrypted data transmitted from the sink pad, call the drm_decrypt() function to complete the decryption, form the raw data, then determine the decrypted data type, call the caps negotiation, and push the data to the corresponding audio decoding component and video decoding component. In the process of transmitting the encrypted data, in order to synchronize the processed audio and video data, the corresponding time stamp may be marked in the data, so that the subsequently connected components can use the time stamp to perform the corresponding audio and video data synchronization processing.
再参照图4,图4为本发明GStreamer解密加密数据的方法另一实施例的流程示意图。Referring to FIG. 4 again, FIG. 4 is a schematic flowchart diagram of another embodiment of a method for decrypting encrypted data by GStreamer according to the present invention.
基于上述第一实施例,本发明第四实施例中,本发明GStreamer解密加密数据的方法在步骤S10之前还包括:Based on the foregoing first embodiment, in the fourth embodiment of the present invention, the method for decrypting the encrypted data by the GStreamer of the present invention further includes: before step S10:
步骤S50:在管道中创建用于收集和管理加密数据的源元件;其中,所述管道为playbin2管道,所述源元件为pysrc元件。Step S50: Create a source component for collecting and managing encrypted data in the pipeline; wherein the pipeline is a playbin2 pipeline, and the source component is a pysrc component.
playbin2是GStreamer中一个比较高级的管道,它能实现元件的自动加载和连接,它会根据数据流的类型的变换以及元件列表中所注册的元件特性自动组装从输入到输出的一条完整的转换链。Playbin2 is a relatively advanced pipeline in GStreamer that automates the loading and linking of components. It automatically assembles a complete conversion chain from input to output based on the type of data stream transformation and the component properties registered in the component list. .
在playbin2管道中创建一个用于收集加密数据的源元件,从而可以将带drm的流媒体数据的下载、解析交由源元件进行管理。A source component for collecting encrypted data is created in the playbin2 pipeline, so that the download and analysis of the streaming media data with drm can be managed by the source component.
再参照图5,图5为图4中步骤S50的流程示意图。Referring again to FIG. 5, FIG. 5 is a schematic flow chart of step S50 in FIG.
基于上述第四实施例,本发明第五实施例中,步骤S50包括:Based on the fourth embodiment, in the fifth embodiment of the present invention, step S50 includes:
步骤S51:根据pysrc协议解析标识源元件的URL,查找需要下载的pysrc元件;Step S51: parsing the URL of the identifier source component according to the pysrc protocol, and searching for the pysrc component to be downloaded;
步骤S52:修改playbin2管道的uri属性为所述pysrc元件所对应的属性;Step S52: Modify the uri attribute of the playbin2 pipeline to be an attribute corresponding to the pysrc component;
步骤S53:通过playbin2管道根据uri属性将所述pysrc元件添加到管道中;Step S53: adding the pysrc component to the pipeline according to the uri attribute through the playbin2 pipeline;
步骤S54:修改pysrc元件的属性以使其处于就绪状态;Step S54: Modify the attributes of the pysrc component to make it in the ready state;
步骤S55:在pysrc元件中创建用于管理所述加密数据的队列;Step S55: creating a queue for managing the encrypted data in the pysrc element;
步骤S56:根据pysrc元件的属性设置源衬垫,以将所述队列读取到的加密数据推送到源衬垫上。Step S56: The source pad is set according to the attribute of the pysrc element to push the encrypted data read by the queue onto the source pad.
播放系统对流媒体数据的访问是通过流媒体的URL(Uniform Resource Locator,统一资源定位符)实现的,而gstrreamer中针对不同的协议会找到不同的源元件,从而需要先对URL进行解析。为了让playbin2管道找到的pysrc元件,设置带有pysrc协议的URL,对于新的source元件设置新的URL时,要调用元件重写的iface->set_uri()函数,具体对应的函数是gst_pysrc_uri_handler_init()函数,该gst_pysrc_uri_handler_init()函数注册了四个函数_get_type ()函数、_get_protocols()函数、_set_uri()和函数_get_uri()函数,这些函数主要完成分析URL,获得流媒体数据类型、传输协议、新的pysrc URL,以及与pysrc URL对应的request uri(通用资源标识符请求)生成并被存储。当源元件启动时,生成的request uri会传递到数据收集模块,此时可以准备为管道读取数据。从而,根据pysrc协议解析标识源元件的URL,通过分析URL,可以查找到需要下载的pysrc元件。The playback system accesses streaming media data through the URL of the streaming media (Uniform Resource Locator, Uniform Resource Locator), and gstrreamer will find different source components for different protocols, so you need to parse the URL first. In order to get the pysrc component found by the playbin2 pipeline, set the URL with the pysrc protocol. When setting a new URL for the new source component, call the iface->set_uri() function of the component override. The corresponding function is gst_pysrc_uri_handler_init(). Function, the gst_pysrc_uri_handler_init() function registers four functions _get_type () function, _get_protocols () function, _set_uri () and function _get_uri () function, these functions mainly complete the analysis of the URL, get the streaming data type, transport protocol, new pysrc The URL, and the request URI (general resource identifier request) corresponding to the pysrc URL are generated and stored. The generated request when the source component starts The uri is passed to the data collection module, where it is ready to read the data for the pipeline. Thus, the URL of the identity source component is parsed according to the pysrc protocol, and by analyzing the URL, the pysrc component that needs to be downloaded can be found.
在本实施例中,修改pysrc元件的属性以使其处于就绪状态的具体过程为:通过playbin2管道添加完pysrc元件后输出source-setup信号;状态改写函数根据上述source-setup信号改写pysrc元件的属性,并将pysrc元件的设置为就绪状态,即准备状态。In this embodiment, the specific process of modifying the attributes of the pysrc component to make it in the ready state is: outputting the source-setup signal after adding the pysrc component through the playbin2 pipeline; the state rewriting function rewriting the attributes of the pysrc component according to the source-setup signal described above. And set the pysrc component to the ready state, which is the ready state.
本实施例通过创建queue队列来完成数据收集模块的缓冲区的管理,而queue队列是Gstreamer的基类继承的,从而可以将外部数据和gstreamer统一起来。In this embodiment, the buffer of the data collection module is managed by creating a queue queue, and the queue queue is inherited by the Gstreamer base class, so that the external data and the gstreamer can be unified.
本实施例通过设置源衬垫来将queue队列上的加密数据取出来,送到源衬垫上的缓冲区。当管道连接成功后,可以将数据传递给解密元件,本实施例优选将源衬垫设置成永久的衬垫(即静态衬垫),具体可将设置GstStaticPadTemplate属性值为“applacation/playready”。此外,根据实际需要也可以将源衬垫设置成动态衬垫,在此不作限制。This embodiment takes the encrypted data on the queue queue by setting the source pad and sends it to the buffer on the source pad. After the pipeline connection is successful, the data can be transferred to the decryption component. In this embodiment, the source pad is preferably set as a permanent pad (ie, a static pad), and the GstStaticPadTemplate attribute value can be set to "applacation/playready". In addition, the source pad can also be set as a dynamic pad according to actual needs, which is not limited herein.
再参照图6,图6为本发明GStreamer解密加密数据的方法又一实施例的流程示意图。Referring again to FIG. 6, FIG. 6 is a schematic flowchart diagram of still another embodiment of a method for decrypting encrypted data by GStreamer according to the present invention.
基于上述实施例,本发明第六实施例中,本发明GStreamer解密加密数据的方法在步骤S10之前还包括:Based on the above embodiment, in the sixth embodiment of the present invention, the method for decrypting the encrypted data by the GStreamer of the present invention further includes:
步骤S60:在管道中创建解密元件和解码元件。Step S60: Creating a decryption element and a decoding element in the pipeline.
本实施例通过在管道中创建解密元件来对加密数据进行解密处理,从而能够实现对含有加密信息的流媒体数据进行解密,确保流媒体数据的正常播放。In this embodiment, the encrypted data is decrypted by creating a decryption component in the pipeline, thereby enabling decryption of the streaming media data containing the encrypted information, and ensuring normal playback of the streaming media data.
本发明还提供一种GStreamer解密加密数据的装置。The present invention also provides an apparatus for GStreamer to decrypt encrypted data.
参照图7,图7为本发明GStreamer解密加密数据的装置一实施例的结构示意图。Referring to FIG. 7, FIG. 7 is a schematic structural diagram of an apparatus for decrypting encrypted data by GStreamer according to an embodiment of the present invention.
如图7所示,所述GStreamer解密加密数据的装置包括:As shown in FIG. 7, the device for decrypting encrypted data by the GStreamer includes:
元件创建模块100,用于在管道中创建独立的数据收集模块,将所述数据收集模块在源元件中;a component creation module 100, configured to create an independent data collection module in the pipeline, and the data collection module is in the source component;
数据下载模块200,用于通过源元件收集的加密数据,并将所述加密数据推送到解密元件;a data downloading module 200, configured to encrypt data collected by a source component, and push the encrypted data to a decryption component;
数据解密模块300,用于通过解密元件对所述加密数据进行解密,并将解密后的数据推送到解码元件;The data decryption module 300 is configured to decrypt the encrypted data by using a decryption component, and push the decrypted data to the decoding component;
数据解码模块400,用于通过解码元件对解密后的数据进行解码,以播放解码后的数据。The data decoding module 400 is configured to decode the decrypted data by the decoding component to play the decoded data.
在本实施例中,元件创建模块100在管道中创建独立的数据收集模块,将所述数据收集模块在源元件中,以通过源元件收集加密数据。数据下载模块200通过源元件的数据收集模块收集加密数据,例如收集带DRM加密信息的流媒体数据,带DRM加密信息的流媒体数据的数据来源可以为本地硬盘数据、网络服务器、电视数据或第三方下载数据。数据下载模块200通过源元件将所下载的加密数据推送到解密元件,数据解密模块300通过解密元件对接收到的加密数据进行解密,并将解密后的数据推送到解码元件,数据解码模块400通过解码元件对解密后的数据进行解码,以播放解码后的数据。In this embodiment, the component creation module 100 creates an independent data collection module in the pipeline, the data collection module being in the source component to collect the encrypted data by the source component. The data download module 200 collects encrypted data by using a data collection module of the source component, for example, collecting streaming media data with DRM encrypted information, and the data source of the streaming media data with DRM encrypted information may be local hard disk data, network server, television data, or Three parties download the data. The data downloading module 200 pushes the downloaded encrypted data to the decryption component through the source component, the data decryption module 300 decrypts the received encrypted data through the decryption component, and pushes the decrypted data to the decoding component, and the data decoding module 400 passes The decoding component decodes the decrypted data to play the decoded data.
相对于现有技术,本发明GStreamer解密加密数据的装置,在管道中创建独立的数据收集模块,并将数据收集模块集成在源元件中,以收集加密数据,通过解密元件对源元件收集的加密数据进行解密,使得解密后的数据能够经过解码元件解码后推送到对应的音频解码插件和视频解码插件,使得下载的加密数据能够正常在管道中播放。从而实现了对加密数据进行解密,能够确保管道正常播放加密数据。Compared with the prior art, the GStreamer of the present invention decrypts encrypted data, creates an independent data collection module in the pipeline, and integrates the data collection module in the source component to collect the encrypted data and encrypt the source component through the decryption component. The data is decrypted, so that the decrypted data can be decoded by the decoding component and then pushed to the corresponding audio decoding plug-in and video decoding plug-in, so that the downloaded encrypted data can be played normally in the pipeline. Thereby, the decryption of the encrypted data is realized, and the pipeline can ensure that the encrypted data is normally played.
具体地,所述数据下载模块200具体用于:Specifically, the data download module 200 is specifically configured to:
设置所述源元件的状态为正在处理状态,将从管道传输过来的含有uri属性的加密数据传递给数据收集模块,通过数据收集模块将所述加密数据保存到一临时缓冲区中;Setting the state of the source component to a processing state, and transmitting the encrypted data containing the uri attribute transmitted from the pipeline to the data collection module, and saving the encrypted data to a temporary buffer through the data collection module;
由回调函数将缓冲区中的加密数据传递到源元件的队列中;Passing the encrypted data in the buffer to the queue of the source component by the callback function;
根据源元件的属性设置源衬垫,将回调上来的加密数据推送到所述源衬垫上,通过所述源衬垫将加密数据推送到解密元件。The source pad is set according to the attributes of the source element, and the encrypted data from the callback is pushed onto the source pad, and the encrypted data is pushed to the decryption element by the source pad.
本实施例通过将源元件的状态为正在处理状态,以对收集的加密数据进行处理,并将从管道传输过来的含有uri(Uniform Resource Identifier,通用资源标识符)属性的加密数据传递给数据收集模块,数据收集模块具体根据加密数据的数据来源(即本地硬盘数据、网络服务器、电视数据或第三方下载数据),将收集的加密数据保存到一临时缓冲区中。In this embodiment, the collected encrypted data is processed by the state of the source element as being processed, and the uri (Uniform Resource) transmitted from the pipeline is included. Identifier, universal resource identifier) The encrypted data of the attribute is passed to the data collection module, and the data collection module collects the encrypted data according to the data source of the encrypted data (ie, local hard disk data, network server, television data, or third party downloaded data). Save to a temporary buffer.
在数据收集模块保存收集到的加密数据后,可由回调函数将缓冲区中的加密数据传递到源元件已创建好的队列中。After the data collection module saves the collected encrypted data, the encrypted data in the buffer can be passed to the queue created by the source component by the callback function.
在将加密数据传递到源元件中的队列后,根据源元件的属性设置源衬垫,并将回调到队列中的加密数据推送到所述源衬垫上,由于源元件的源衬垫与解密元件连接,从而可通过源衬垫将加密数据推送到解密元件。After passing the encrypted data to the queue in the source element, the source pad is set according to the attributes of the source element, and the encrypted data that is recalled into the queue is pushed onto the source pad, due to the source pad and decryption of the source element The components are connected so that the encrypted data can be pushed to the decryption component through the source pad.
本实施例具体将回调上来的加密数据通过g_queue_push_tail()函数推送到已创建好的源元件的源衬垫上,通过g_queue_pop_head()函数将加密数据推送到源衬垫上的缓冲区,源衬垫主要作用是向解密元件流化数据,建立收集-解密通道,从而将源衬垫上的缓冲区中的加密数据推送到解密元件。In this embodiment, the encrypted data of the callback is specifically pushed to the source pad of the created source component by the g_queue_push_tail() function, and the encrypted data is pushed to the buffer on the source pad by the g_queue_pop_head() function, and the source pad is used. The primary role is to stream data to the decryption component, establishing a collection-decryption channel to push the encrypted data in the buffer on the source pad to the decryption component.
具体地,所述数据解密模块300具体用于:Specifically, the data decryption module 300 is specifically configured to:
创建解密模块,将所述解密模块集成到所述解密元件;Creating a decryption module, integrating the decryption module into the decryption component;
创建解密元件的sink衬垫和src衬垫;Creating a sink pad and a src pad for the decryption component;
根据加密数据的解密方式设置解密元件的属性;Setting the attribute of the decryption element according to the decryption manner of the encrypted data;
在sink衬垫的缓冲区中将加密数据拷贝到解密模块进行解密;Copying the encrypted data to the decryption module for decryption in the buffer of the sink pad;
根据解密后的数据类型,向管道中的解码元件推送解密后的数据。The decrypted data is pushed to the decoding component in the pipeline according to the decrypted data type.
本实施例通过创建解密模块来解密加密数据,同时,创建解密元件的sink衬垫,以接收源衬垫的加密数据;创建解密元件的src衬垫,以向管道后端的解码元件推送解密后的数据。注册caps函数和和chain函数,通过Caps函数决定相连接的衬垫,并决定流经衬垫之间的数据流的类型,通过chain函数可以对流经的数据进行解密处理。从而根据加密数据的解密方式通过g_object_set()函数设置解密元件的属性,通过chain函数拷贝sink衬垫的缓冲区中的加密数据到解密模块进行解密,根据解密后的数据,判断解密得到的数据的类型,分别向管道中的视频解码插件和音频解码插件推送解密后的数据。In this embodiment, the decryption module is created to decrypt the encrypted data, and at the same time, the sink pad of the decryption component is created to receive the encrypted data of the source pad; the src pad of the decryption component is created to push the decrypted component to the decoding component at the back end of the pipeline. data. Register the caps function and the chain function, determine the connected pad through the Caps function, and determine the type of data stream flowing between the pads. The chain function can decrypt the data flowing through the chain function. Therefore, according to the decryption mode of the encrypted data, the attribute of the decryption component is set by the g_object_set() function, the encrypted data in the buffer of the sink pad is copied by the chain function to the decryption module for decryption, and the decrypted data is judged according to the decrypted data. Type, respectively, to the video decoding plug-in and audio decoding plug-in in the pipeline to push the decrypted data.
加密的流媒体数据被处理的过程中,流媒体数据流经pysrc元件后,无论是音频还是视频数据都必然要进行解密处理,才可以被解码元件进行解码处理,据此,需要封装解密模块,封装过程需要在头文件定义新对象的实例结构和类结构,解密相关的参数都设置在实例结构体内。In the process of processing the encrypted streaming media data, after the streaming media data flows through the pysrc component, both the audio and the video data must be decrypted before being decoded by the decoding component. Accordingly, the decryption module needs to be encapsulated. The encapsulation process needs to define the instance structure and class structure of the new object in the header file, and the parameters related to decryption are set in the instance structure.
根据解密模块的解密参数需要,需要设置元件的属性,这可通过设置GObject的属性完成,GObject的属性在_ class_init()函数中定义。具体的实施过程可以通过GStreamer的系统函数g_object_set()函数对元件的管道属性进行修改,解密元件内部可通过执行_set_property()或_get_porterty()函数,来获得应用设置好的参数值。According to the decryption parameters of the decryption module, you need to set the properties of the component. This can be done by setting the properties of GObject. The properties of GObject are in _ Defined in the class_init() function. The specific implementation process can modify the pipeline property of the component through the GStreamer system function g_object_set() function. The decryption component can obtain the parameter value set by the application by executing the _set_property() or _get_porterty() function.
sink衬垫用于接收pysrc元件传递过来的加密数据,由于本实施将sink衬垫设置成永久的衬垫,因此这里不进行caps协商。因为pysrc元件传递过来的还是带加密的数据,可以直接将sink衬垫设置成静态衬垫,具体可将设置GstStaticPadTemplate属性值为“applacation/playready”。从而当pysrc元件的src衬垫流化数据时,就能够自动找到解密元件,进而解密元件与源元件可以连接起来。而src衬垫负责的是将解密后的数据往下游的解码元件推送,所以设置src衬垫有一些差别,这里设置src衬垫参数为ANY,即表示所有数据都能够通过,在plugin_init()函数中注册sink衬垫和src衬垫,完成解密元件衬垫的设置。解密元件的衬垫创建完成后,要设置 gst_pad_set_setcaps_function()函数; 随后调用gst_pad_set_caps()函数来设置衬垫的固定caps属性,从而可以控制流经衬垫的数据类型,将数据分别传输到对应的视频解码插件和音频解码插件。The sink pad is used to receive the encrypted data passed by the pysrc component. Since the sink pad is set to a permanent pad, the caps negotiation is not performed here. Because the pysrc component is passed with encrypted data, you can directly set the sink pad to a static pad. You can set the GstStaticPadTemplate property value to "applacation/playready". Thus, when the src pad of the pysrc component fluidizes the data, the decryption component can be automatically found, and the decryption component can be connected to the source component. The src pad is responsible for pushing the decrypted data to the downstream decoding component, so there are some differences in setting the src pad. Here, setting the src pad parameter to ANY means that all data can pass, in the plugin_init() function. Register the sink pad and the src pad to complete the setting of the decryption component pad. After the pad of the decryption component is created, it is set Gst_pad_set_setcaps_function() function; The gst_pad_set_caps() function is then called to set the fixed caps property of the pad, so that the data type flowing through the pad can be controlled to transmit the data to the corresponding video decoding plug-in and audio decoding plug-in respectively.
在本实施例中,chain函数绑定在sink衬垫,确保从pysrc元件流化过来的加密数据能够直接进行处理。对于从sink衬垫传输进来的加密数据,调用drm_decrypt()函数完成解密,形成raw数据,然后判断解密后的数据类型,调用caps协商,将数据推送到对应的音频解码元件和视频解码元件,在加密数据的传递过程中,为了使得处理的音视频数据同步,可以在数据标记相应的时间戳,从而后续连接的元件可以利用时间戳进行相应的音视频数据同步处理。In this embodiment, the chain function is bound to the sink pad to ensure that the encrypted data streamed from the pysrc component can be processed directly. For the encrypted data transmitted from the sink pad, call the drm_decrypt() function to complete the decryption, form the raw data, then determine the decrypted data type, call the caps negotiation, and push the data to the corresponding audio decoding component and video decoding component. In the process of transmitting the encrypted data, in order to synchronize the processed audio and video data, the corresponding time stamp may be marked in the data, so that the subsequently connected components can use the time stamp to perform the corresponding audio and video data synchronization processing.
具体地,元件创建模块100还用于在管道中创建用于收集和管理加密数据的源元件;其中,所述管道为playbin2管道,所述源元件为pysrc元件。Specifically, the component creation module 100 is further configured to create a source component for collecting and managing encrypted data in the pipeline; wherein the pipeline is a playbin2 pipeline, and the source component is a pysrc component.
playbin2是GStreamer中一个比较高级的管道,它能实现元件的自动加载和连接,它会根据数据流的类型的变换以及元件列表中所注册的元件特性自动组装从输入到输出的一条完整的转换链。Playbin2 is a relatively advanced pipeline in GStreamer that automates the loading and linking of components. It automatically assembles a complete conversion chain from input to output based on the type of data stream transformation and the component properties registered in the component list. .
在playbin2管道中创建一个用于收集加密数据的源元件,从而可以将带drm的流媒体数据的下载、解析交由源元件进行管理。A source component for collecting encrypted data is created in the playbin2 pipeline, so that the download and analysis of the streaming media data with drm can be managed by the source component.
其中,所述元件创建模块100在管道中创建用于收集和管理加密数据的源元件具体为:The source component for creating and managing encrypted data in the pipeline by the component creation module 100 is specifically:
根据pysrc协议解析标识源元件的URL,查找需要下载的pysrc元件;Parsing the URL of the identity source component according to the pysrc protocol, and finding the pysrc component that needs to be downloaded;
修改playbin2管道的uri属性为所述pysrc元件所对应的属性;Modifying the uri attribute of the playbin2 pipeline to the attribute corresponding to the pysrc component;
通过playbin2管道根据uri属性将所述pysrc元件添加到管道中;Adding the pysrc component to the pipeline according to the uri attribute through the playbin2 pipeline;
修改pysrc元件的属性以使其处于就绪状态;Modify the properties of the pysrc component to make it ready;
在pysrc元件中创建用于管理所述加密数据的队列;Creating a queue for managing the encrypted data in the pysrc element;
根据pysrc元件的属性设置源衬垫,以将所述队列读取到的加密数据推送到源衬垫上。The source pad is set according to the attributes of the pysrc element to push the encrypted data read by the queue onto the source pad.
播放系统对流媒体数据的访问是通过流媒体的URL(Uniform Resource Locator,统一资源定位符)实现的,而gstrreamer中针对不同的协议会找到不同的源元件,从而需要先对URL进行解析。为了让playbin2管道找到的pysrc元件,设置带有pysrc协议的URL,对于新的source元件设置新的URL时,要调用元件重写的iface->set_uri()函数,具体对应的函数是gst_pysrc_uri_handler_init()函数,该gst_pysrc_uri_handler_init()函数注册了四个函数_get_type ()函数、_get_protocols()函数、_set_uri()和函数_get_uri()函数,这些函数主要完成分析URL,获得流媒体数据类型、传输协议、新的pysrc URL,以及与pysrc URL对应的request uri(通用资源标识符请求)生成并被存储。当源元件启动时,生成的request uri会传递到数据收集模块,此时可以准备为管道读取数据。从而,根据pysrc协议解析标识源元件的URL,通过分析URL,可以查找到需要下载的pysrc元件。The playback system accesses streaming media data through the URL of the streaming media (Uniform Resource Locator, Uniform Resource Locator), and gstrreamer will find different source components for different protocols, so you need to parse the URL first. In order to get the pysrc component found by the playbin2 pipeline, set the URL with the pysrc protocol. When setting a new URL for the new source component, call the iface->set_uri() function of the component override. The corresponding function is gst_pysrc_uri_handler_init(). Function, the gst_pysrc_uri_handler_init() function registers four functions _get_type () function, _get_protocols () function, _set_uri () and function _get_uri () function, these functions mainly complete the analysis of the URL, get the streaming data type, transport protocol, new pysrc The URL, and the request URI (general resource identifier request) corresponding to the pysrc URL are generated and stored. The generated request when the source component starts The uri is passed to the data collection module, where it is ready to read the data for the pipeline. Thus, the URL of the identity source component is parsed according to the pysrc protocol, and by analyzing the URL, the pysrc component that needs to be downloaded can be found.
在本实施例中,修改pysrc元件的属性以使其处于就绪状态的具体过程为:通过playbin2管道添加完pysrc元件后输出source-setup信号;状态改写函数根据上述source-setup信号改写pysrc元件的属性,并将pysrc元件的设置为就绪状态,即准备状态。In this embodiment, the specific process of modifying the attributes of the pysrc component to make it in the ready state is: outputting the source-setup signal after adding the pysrc component through the playbin2 pipeline; the state rewriting function rewriting the attributes of the pysrc component according to the source-setup signal described above. And set the pysrc component to the ready state, which is the ready state.
本实施例通过创建queue队列来完成数据收集模块的缓冲区的管理,而queue队列是Gstreamer的基类继承的,从而可以将外部数据和gstreamer统一起来。In this embodiment, the buffer of the data collection module is managed by creating a queue queue, and the queue queue is inherited by the Gstreamer base class, so that the external data and the gstreamer can be unified.
本实施例通过设置源衬垫来将queue队列上的加密数据取出来,送到源衬垫上的缓冲区。当管道连接成功后,可以将数据传递给解密元件,本实施例优选将源衬垫设置成永久的衬垫(即静态衬垫),具体可将设置GstStaticPadTemplate属性值为“applacation/playready”。此外,根据实际需要也可以将源衬垫设置成动态衬垫,在此不作限制。This embodiment takes the encrypted data on the queue queue by setting the source pad and sends it to the buffer on the source pad. After the pipeline connection is successful, the data can be transferred to the decryption component. In this embodiment, the source pad is preferably set as a permanent pad (ie, a static pad), and the GstStaticPadTemplate attribute value can be set to "applacation/playready". In addition, the source pad can also be set as a dynamic pad according to actual needs, which is not limited herein.
具体地,所述元件创建模块100还用于在管道中创建解密元件和解码元件。Specifically, the component creation module 100 is further configured to create a decryption component and a decoding component in a pipeline.
本实施例通过元件创建模块100在管道中创建解密元件来对加密数据进行解密处理,从而能够实现对含有加密信息的流媒体数据进行解密,确保流媒体数据的正常播放。In this embodiment, the component creation module 100 creates a decryption component in the pipeline to decrypt the encrypted data, thereby enabling decryption of the streaming media data containing the encrypted information, and ensuring normal playback of the streaming media data.
以上所述仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above is only the preferred embodiment of the present invention, and is not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the invention and the drawings are directly or indirectly applied to other related The technical field is equally included in the scope of patent protection of the present invention.

Claims (20)

  1. 一种GStreamer解密加密数据的方法,其特征在于,所述GStreamer解密加密数据的方法包括以下步骤: A method for decrypting encrypted data by a GStreamer, characterized in that the method for decrypting encrypted data by the GStreamer comprises the following steps:
    在管道中创建独立的数据收集模块,将所述数据收集模块集成在源元件中;Creating a separate data collection module in the pipeline, integrating the data collection module in the source component;
    通过源元件中的数据收集模块收集加密数据,将所收集的加密数据传递到源元件已创建的队列中,并将所述加密数据推送到解密元件;Collecting encrypted data through a data collection module in the source component, passing the collected encrypted data to a queue that the source component has created, and pushing the encrypted data to the decryption component;
    通过解密元件对所述加密数据进行解密,并将解密后的数据推送到解码元件;Decrypting the encrypted data by a decryption component and pushing the decrypted data to a decoding component;
    通过解码元件对解密后的数据进行解码,以播放解码后的数据。The decrypted data is decoded by the decoding component to play the decoded data.
  2. 如权利要求1所述的GStreamer解密加密数据的方法,其特征在于,所述通过源元件中的数据收集模块收集加密数据,将所收集的加密数据传递到源元件已创建的队列中,并将所述加密数据推送到解密元件的步骤包括:The method for decrypting encrypted data by the GStreamer according to claim 1, wherein the encrypted data is collected by a data collection module in the source component, and the collected encrypted data is transferred to a queue that the source component has created, and The step of pushing the encrypted data to the decryption component includes:
    设置所述源元件的状态为正在处理状态,将从管道传输过来的含有uri属性的加密数据传递给数据收集模块,通过数据收集模块将所述加密数据保存到一临时缓冲区中;Setting the state of the source component to a processing state, and transmitting the encrypted data containing the uri attribute transmitted from the pipeline to the data collection module, and saving the encrypted data to a temporary buffer through the data collection module;
    由回调函数将缓冲区中的加密数据传递到源元件的队列中;Passing the encrypted data in the buffer to the queue of the source component by the callback function;
    根据源元件的属性设置源衬垫,将回调上来的加密数据推送到所述源衬垫上,通过所述源衬垫将加密数据推送到解密元件。The source pad is set according to the attributes of the source element, and the encrypted data from the callback is pushed onto the source pad, and the encrypted data is pushed to the decryption element by the source pad.
  3. 如权利要求2所述的GStreamer解密加密数据的方法,其特征在于,所述根据源元件的属性设置源衬垫,将回调上来的加密数据推送到所述源衬垫上,通过所述源衬垫将加密数据推送到解密元件的步骤具体为:The method of claim 2, wherein the GStreamer decrypts the encrypted data, wherein the source pad is set according to an attribute of the source element, and the encrypted data sent back to the source pad is pushed to the source pad, and the source pad is The step of pushing the encrypted data to the decryption component is as follows:
    根据源元件的属性设置源衬垫,将回调上来的加密数据通过g_queue_push_tail()函数推送到源元件的源衬垫上,通过g_queue_pop_head()函数将加密数据推送到源衬垫上的缓冲区,将源衬垫上的缓冲区中的加密数据推送到解密元件。Set the source pad according to the attributes of the source component, push the encrypted data from the callback to the source pad of the source component through the g_queue_push_tail() function, and push the encrypted data to the buffer on the source pad through the g_queue_pop_head() function. The encrypted data in the buffer on the source pad is pushed to the decryption element.
  4. 如权利要求1所述的GStreamer解密加密数据的方法,其特征在于,所述通过解密元件对所述加密数据进行解密,并将解密后的数据推送到解码元件的步骤包括:A method for decrypting encrypted data by a GStreamer according to claim 1, wherein said step of decrypting said encrypted data by said decrypting element and pushing said decrypted data to said decoding element comprises:
    创建解密模块,将所述解密模块集成到所述解密元件;Creating a decryption module, integrating the decryption module into the decryption component;
    创建解密元件的sink衬垫和src衬垫;Creating a sink pad and a src pad for the decryption component;
    根据加密数据的解密方式设置解密元件的属性;Setting the attribute of the decryption element according to the decryption manner of the encrypted data;
    在sink衬垫的缓冲区中将加密数据拷贝到解密模块进行解密;Copying the encrypted data to the decryption module for decryption in the buffer of the sink pad;
    根据解密后的数据类型,向管道中的解码元件推送解密后的数据。The decrypted data is pushed to the decoding component in the pipeline according to the decrypted data type.
  5. 如权利要求1所述的GStreamer解密加密数据的方法,其特征在于,所述GStreamer解密加密数据的方法还包括:The method for decrypting encrypted data by the GStreamer according to claim 1, wherein the method for decrypting the encrypted data by the GStreamer further comprises:
    在管道中创建用于收集和管理加密数据的源元件;所述管道为playbin2管道,所述源元件为pysrc元件;Creating a source element for collecting and managing encrypted data in a pipeline; the pipeline is a playbin2 pipeline, and the source component is a pysrc component;
    所述在管道中创建用于收集和管理加密数据的源元件的步骤包括:The steps of creating a source component for collecting and managing encrypted data in the pipeline include:
    根据pysrc协议解析标识源元件的URL,查找需要下载的pysrc元件;Parsing the URL of the identity source component according to the pysrc protocol, and finding the pysrc component that needs to be downloaded;
    修改playbin2管道的uri属性为所述pysrc元件所对应的属性;Modifying the uri attribute of the playbin2 pipeline to the attribute corresponding to the pysrc component;
    通过playbin2管道根据uri属性将所述pysrc元件添加到管道中;Adding the pysrc component to the pipeline according to the uri attribute through the playbin2 pipeline;
    修改pysrc元件的属性以使其处于就绪状态;Modify the properties of the pysrc component to make it ready;
    在pysrc元件中创建用于管理所述加密数据的队列;Creating a queue for managing the encrypted data in the pysrc element;
    根据pysrc元件的属性设置源衬垫,以将所述队列读取到的加密数据推送到源衬垫上。The source pad is set according to the attributes of the pysrc element to push the encrypted data read by the queue onto the source pad.
  6. 如权利要求5所述的GStreamer解密加密数据的方法,其特征在于,所述修改pysrc元件的属性以使其处于就绪状态的步骤具体为:The method for decrypting encrypted data by GStreamer according to claim 5, wherein the step of modifying an attribute of the pysrc element to make it in a ready state is specifically:
    通过playbin2管道添加完pysrc元件后输出source-setup信号;状态改写函数根据上述source-setup信号改写pysrc元件的属性,并将pysrc元件的设置为就绪状态。After the pysrc component is added through the playbin2 pipeline, the source-setup signal is output; the state rewriting function rewrites the properties of the pysrc component according to the source-setup signal, and sets the pysrc component to the ready state.
  7. 如权利要求1所述的GStreamer解密加密数据的方法,其特征在于,所述GStreamer解密加密数据的方法还包括:The method for decrypting encrypted data by the GStreamer according to claim 1, wherein the method for decrypting the encrypted data by the GStreamer further comprises:
    在管道中创建解密元件和解码元件。A decryption element and a decoding element are created in the pipeline.
  8. 如权利要求2所述的GStreamer解密加密数据的方法,其特征在于,所述GStreamer解密加密数据的方法还包括:The method for decrypting encrypted data by the GStreamer according to claim 2, wherein the method for decrypting the encrypted data by the GStreamer further comprises:
    在管道中创建解密元件和解码元件。A decryption element and a decoding element are created in the pipeline.
  9. 如权利要求4所述的GStreamer解密加密数据的方法,其特征在于,所述GStreamer解密加密数据的方法还包括:The method for decrypting encrypted data by the GStreamer according to claim 4, wherein the method for decrypting the encrypted data by the GStreamer further comprises:
    在管道中创建解密元件和解码元件。A decryption element and a decoding element are created in the pipeline.
  10. 如权利要求5所述的GStreamer解密加密数据的方法,其特征在于,所述GStreamer解密加密数据的方法还包括:The method for decrypting encrypted data by the GStreamer according to claim 5, wherein the method for decrypting the encrypted data by the GStreamer further comprises:
    在管道中创建解密元件和解码元件。A decryption element and a decoding element are created in the pipeline.
  11. 一种GStreamer解密加密数据的装置,其特征在于,所述GStreamer解密加密数据的装置包括:An apparatus for decrypting encrypted data by a GStreamer, wherein the apparatus for decrypting encrypted data by the GStreamer includes:
    元件创建模块,用于在管道中创建独立的数据收集模块,将所述数据收集模块在源元件中;a component creation module, configured to create an independent data collection module in the pipeline, and the data collection module is in the source component;
    数据下载模块,用于通过源元件中的数据收集模块收集加密数据,将所收集的加密数据传递到源元件已创建的队列中,并将所述加密数据推送到解密元件;a data downloading module, configured to collect encrypted data by using a data collection module in the source component, transfer the collected encrypted data to a queue that the source component has created, and push the encrypted data to the decryption component;
    数据解密模块,用于通过解密元件对所述加密数据进行解密,并将解密后的数据推送到解码元件;a data decryption module, configured to decrypt the encrypted data by a decryption component, and push the decrypted data to a decoding component;
    数据解码模块,用于通过解码元件对解密后的数据进行解码,以播放解码后的数据。The data decoding module is configured to decode the decrypted data by the decoding component to play the decoded data.
  12. 如权利要求11所述的GStreamer解密加密数据的装置,其特征在于,所述数据下载模块具体用于:The apparatus for decrypting encrypted data by the GStreamer according to claim 11, wherein the data downloading module is specifically configured to:
    设置所述源元件的状态为正在处理状态,将从管道传输过来的含有uri属性的加密数据传递给数据收集模块,通过数据收集模块将所述加密数据保存到一临时缓冲区中;Setting the state of the source component to a processing state, and transmitting the encrypted data containing the uri attribute transmitted from the pipeline to the data collection module, and saving the encrypted data to a temporary buffer through the data collection module;
    由回调函数将缓冲区中的加密数据传递到源元件的队列中;Passing the encrypted data in the buffer to the queue of the source component by the callback function;
    根据源元件的属性设置源衬垫,将回调上来的加密数据推送到所述源衬垫上,通过所述源衬垫将加密数据推送到解密元件。The source pad is set according to the attributes of the source element, and the encrypted data from the callback is pushed onto the source pad, and the encrypted data is pushed to the decryption element by the source pad.
  13. 如权利要求12所述的GStreamer解密加密数据的装置,其特征在于,所述数据下载模块根据源元件的属性设置源衬垫,将回调上来的加密数据推送到所述源衬垫上,通过所述源衬垫将加密数据推送到解密元件具体为:The apparatus for decrypting encrypted data by the GStreamer according to claim 12, wherein the data downloading module sets a source pad according to an attribute of the source component, and pushes the encrypted data sent back to the source pad. The source pad pushes the encrypted data to the decryption component as follows:
    根据源元件的属性设置源衬垫,将回调上来的加密数据通过g_queue_push_tail()函数推送到源元件的源衬垫上,通过g_queue_pop_head()函数将加密数据推送到源衬垫上的缓冲区,将源衬垫上的缓冲区中的加密数据推送到解密元件。Set the source pad according to the attributes of the source component, push the encrypted data from the callback to the source pad of the source component through the g_queue_push_tail() function, and push the encrypted data to the buffer on the source pad through the g_queue_pop_head() function. The encrypted data in the buffer on the source pad is pushed to the decryption element.
  14. 如权利要求11所述的GStreamer解密加密数据的装置,其特征在于,所述数据解密模块具体用于:The apparatus for decrypting encrypted data by the GStreamer according to claim 11, wherein the data decryption module is specifically configured to:
    创建解密模块,将所述解密模块集成到所述解密元件;Creating a decryption module, integrating the decryption module into the decryption component;
    创建解密元件的sink衬垫和src衬垫;Creating a sink pad and a src pad for the decryption component;
    根据加密数据的解密方式设置解密元件的属性;Setting the attribute of the decryption element according to the decryption manner of the encrypted data;
    在sink衬垫的缓冲区中将加密数据拷贝到解密模块进行解密;Copying the encrypted data to the decryption module for decryption in the buffer of the sink pad;
    根据解密后的数据类型,向管道中的解码元件推送解密后的数据。The decrypted data is pushed to the decoding component in the pipeline according to the decrypted data type.
  15. 如权利要求11所述的GStreamer解密加密数据的装置,其特征在于,所述元件创建模块还用于在管道中创建用于收集和管理加密数据的源元件;所述管道为playbin2管道,所述源元件为pysrc元件;The apparatus for decrypting encrypted data by the GStreamer according to claim 11, wherein the component creation module is further configured to create a source component for collecting and managing encrypted data in a pipeline; the pipeline is a playbin2 pipeline, The source component is a pysrc component;
    所述元件创建模块在管道中创建用于收集和管理加密数据的源元件具体为:The component creation module creates a source component in the pipeline for collecting and managing encrypted data, specifically:
    根据pysrc协议解析标识源元件的URL,查找需要下载的pysrc元件;Parsing the URL of the identity source component according to the pysrc protocol, and finding the pysrc component that needs to be downloaded;
    修改playbin2管道的uri属性为所述pysrc元件所对应的属性;Modifying the uri attribute of the playbin2 pipeline to the attribute corresponding to the pysrc component;
    通过playbin2管道根据uri属性将所述pysrc元件添加到管道中;Adding the pysrc component to the pipeline according to the uri attribute through the playbin2 pipeline;
    修改pysrc元件的属性以使其处于就绪状态;Modify the properties of the pysrc component to make it ready;
    在pysrc元件中创建用于管理所述加密数据的队列;Creating a queue for managing the encrypted data in the pysrc element;
    根据pysrc元件的属性设置源衬垫,以将所述队列读取到的加密数据推送到源衬垫上。The source pad is set according to the attributes of the pysrc element to push the encrypted data read by the queue onto the source pad.
  16. 如权利要求15所述的GStreamer解密加密数据的装置,其特征在于,所述元件创建模块修改pysrc元件的属性以使其处于就绪状态具体为:The apparatus for decrypting encrypted data by the GStreamer according to claim 15, wherein the component creation module modifies an attribute of the pysrc element to be in a ready state, specifically:
    通过playbin2管道添加完pysrc元件后输出source-setup信号;状态改写函数根据上述source-setup信号改写pysrc元件的属性,并将pysrc元件的设置为就绪状态。After the pysrc component is added through the playbin2 pipeline, the source-setup signal is output; the state rewriting function rewrites the properties of the pysrc component according to the source-setup signal, and sets the pysrc component to the ready state.
  17. 如权利要求11所述的GStreamer解密加密数据的装置,其特征在于,所述元件创建模块还用于在管道中创建解密元件和解码元件。The apparatus for decrypting encrypted data by a GStreamer according to claim 11, wherein said component creation module is further configured to create a decryption component and a decoding component in a pipeline.
  18. 如权利要求12所述的GStreamer解密加密数据的装置,其特征在于,所述元件创建模块还用于在管道中创建解密元件和解码元件。The apparatus for decrypting encrypted data by a GStreamer according to claim 12, wherein said component creation module is further configured to create a decryption component and a decoding component in the pipeline.
  19. 如权利要求14所述的GStreamer解密加密数据的装置,其特征在于,所述元件创建模块还用于在管道中创建解密元件和解码元件。The apparatus for decrypting encrypted data by a GStreamer according to claim 14, wherein said component creation module is further configured to create a decryption component and a decoding component in a pipeline.
  20. 如权利要求15所述的GStreamer解密加密数据的装置,其特征在于,所述元件创建模块还用于在管道中创建解密元件和解码元件。The apparatus for decrypting encrypted data by a GStreamer according to claim 15, wherein said component creation module is further configured to create a decryption component and a decoding component in the pipeline.
PCT/CN2014/094303 2014-12-15 2014-12-19 Method and device for encrypting and decrypting data by gstreamer WO2016095183A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410778339.4 2014-12-15
CN201410778339.4A CN105763938B (en) 2014-12-15 2014-12-15 GStreamer decrypts the method and device of encryption data

Publications (1)

Publication Number Publication Date
WO2016095183A1 true WO2016095183A1 (en) 2016-06-23

Family

ID=56125643

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/094303 WO2016095183A1 (en) 2014-12-15 2014-12-19 Method and device for encrypting and decrypting data by gstreamer

Country Status (2)

Country Link
CN (1) CN105763938B (en)
WO (1) WO2016095183A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113489705A (en) * 2021-06-30 2021-10-08 中国银联股份有限公司 Method and device storage medium for capturing HTTP (hyper text transport protocol) communication data of application program

Families Citing this family (4)

* Cited by examiner, † Cited by third party
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
CN114071235B (en) * 2021-11-10 2022-12-13 四川长虹电器股份有限公司 Method for improving play black screen performance of player based on gstreamer

Citations (4)

* Cited by examiner, † Cited by third party
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
CN102984571A (en) * 2012-12-07 2013-03-20 青岛海信信芯科技有限公司 External data reading method of Gstreamer in digital television and device thereof
CN103414726A (en) * 2013-08-22 2013-11-27 天脉聚源(北京)传媒科技有限公司 Method and device for transmitting multimedia resources

Patent Citations (4)

* Cited by examiner, † Cited by third party
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
CN102984571A (en) * 2012-12-07 2013-03-20 青岛海信信芯科技有限公司 External data reading method of Gstreamer in digital television and device thereof
CN103414726A (en) * 2013-08-22 2013-11-27 天脉聚源(北京)传媒科技有限公司 Method and device for transmitting multimedia resources

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SHEN, WEIZHONG.: "Framework based on GStreanier set-top box design and realization of the simulator", MASTER OF SCIENCE IN THE CHINESE ACADEMY OF SCIENCES, 30 June 2013 (2013-06-30), pages 52 - 54 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113489705A (en) * 2021-06-30 2021-10-08 中国银联股份有限公司 Method and device storage medium for capturing HTTP (hyper text transport protocol) communication data of application program

Also Published As

Publication number Publication date
CN105763938A (en) 2016-07-13
CN105763938B (en) 2018-09-04

Similar Documents

Publication Publication Date Title
WO2016095183A1 (en) Method and device for encrypting and decrypting data by gstreamer
WO2015008986A1 (en) Method and apparatus for transmitting/receiving broadcast signal in hybrid broadcasting system
WO2014025207A1 (en) A method and an apparatus for processing a broadcast signal including an interactive broadcast service
EP2761880A2 (en) Method and apparatus for transmitting and receiving content
WO2014209057A1 (en) Method and device for transmitting and receiving broadcast service in hybrid broadcast system on basis of connection of terrestrial broadcast network and internet protocol network
WO2010058958A2 (en) Method for processing non-real time service and broadcast receiver
WO2014014252A1 (en) Method and apparatus for processing digital service signals
WO2014007571A1 (en) Method and apparatus for processing digital service signals
WO2019037395A1 (en) Key management method, device and readable storage medium
WO2014003394A1 (en) Apparatus and method for processing an interactive service
WO2010068040A2 (en) Non-real-time service processing method and broadcasting receiver
WO2010082783A2 (en) Non-real-time service processing method and a broadcasting receiver
WO2009131391A1 (en) Method for generating and playing object-based audio contents and computer readable recording medium for recoding data having file format structure for object-based audio service
EP2499780A2 (en) Method and apparatus for providing and receiving data
WO2016111563A1 (en) Method and apparatus for transmitting and receiving media information in communication system
WO2019024336A1 (en) Data query method and device, and computer readable storage medium
WO2010068034A2 (en) Non-realtime service processing method and broadcasting receiver
WO2015009105A1 (en) Apparatus and method for sending/receiving packet in multimedia communication system
WO2018101566A1 (en) Broadcast signal transmitting/receiving device and method
WO2016101702A1 (en) Program recording method and device
WO2016144031A1 (en) Broadcast signal transmission apparatus, broadcast signal reception apparatus, broadcast signal transmission method, and broadcast signal reception method
WO2022005102A1 (en) Method and apparatus for processing multicast signal
WO2017135673A1 (en) Device for transmitting broadcast signal, device for receiving broadcast signal, method for transmitting broadcast signal, and method for receiving broadcast signal
WO2015126057A1 (en) Method and apparatus for converting and reproducing contents in storage medium
WO2016107249A1 (en) Channel search method and device for satellite television

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14908218

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205N DATED 03/11/2017)

122 Ep: pct application non-entry in european phase

Ref document number: 14908218

Country of ref document: EP

Kind code of ref document: A1