Gstreamer DRM file detection

classic Classic list List threaded Threaded
11 messages Options
kcu
Reply | Threaded
Open this post in threaded view
|

Gstreamer DRM file detection

kcu
Hi,
I am developing a gstreamer based media player, i want to check whether a given file is drm file or not. i am a beginner, so please suggest me something...
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer DRM file detection

Tim Müller
On Thu, 2015-06-11 at 21:54 -0700, kcu wrote:

> I am developing a gstreamer based media player, i want to check whether a
> given file is drm file or not. i am a beginner, so please suggest me
> something...

If you try to decode it you'll get an error message on the bus, with a
GError that has error->domain == GST_STREAM_ERROR and error->code ==
GST_STREAM_ERROR_DECRYPT.

Or you use GstDiscoverer, which should give you the same error in the
the 'discovered' signal callback if there was a problem.

 Cheers
  -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
kcu
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer DRM file detection

kcu
Thank you Tim,

I tried using GstDiscoverer, but i am getting errors while compiling my program. The errors are given below.


undefined reference to `gst_discoverer_new'
undefined reference to `gst_discoverer_discover_uri'
undefined reference to `gst_discoverer_info_get_result'
undefined reference to `gst_discoverer_info_get_duration'

I am using the above 4 functions in my program...
Could you suggest what might be the issue...

code snippet:
   GstDiscoverer *disc = NULL;
    GstDiscovererInfo *info = NULL;
    GError *err = NULL;
    GstDiscovererResult result = 6;
    guint64 duration = 0;
   
   disc = gst_discoverer_new(3*GST_SECOND,&err);

    if(!disc)
        {
        printf("\nDiscoverer creation failed");
        printf("\nMessage : %s \n",err->message);
        }

    info = gst_discoverer_discover_uri(disc,gData->currentPlayParams.playparam.FileSystem.filename, &err);

    result =  gst_discoverer_info_get_result(info);

    if(result == GST_DISCOVERER_OK)
       printf("Discoverer OK\n");
    else if(result == GST_DISCOVERER_ERROR)
       printf("Error, Message:%s\n",err->message);
    else if(result == GST_DISCOVERER_TIMEOUT)
       printf("Time out\n");

   duration = gst_discoverer_info_get_duration(info);
   printf("duration = %"G_GUINT64_FORMAT"\n",duration);



Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer DRM file detection

Tim Müller
On Mon, 2015-06-22 at 02:42 -0700, kcu wrote:

Hi,

> I tried using GstDiscoverer, but i am getting errors while compiling my
> program. The errors are given below.
>
>
> undefined reference to `gst_discoverer_new'
> undefined reference to `gst_discoverer_discover_uri'
> undefined reference to `gst_discoverer_info_get_result'
> undefined reference to `gst_discoverer_info_get_duration'

You need to link to libgstpbutils-1.0, add gstreamer-pbutils-1.0 to your
pkg-config stuff.

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
kcu
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer DRM file detection

kcu
I had linked it, still getting those errors. I am using something like this..
`(pkg-config --cflags --libs gstreamer-pbutils-0.10 gstreamer-0.10 gstreamer-app-0.10)`

is this the proper way to compile?
kcu
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer DRM file detection

kcu
Hi Tim,

It's compiling now.. thanks..

I have a doubt can we use gstdiscoverer on local files ?
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer DRM file detection

Nicolas Dufresne-3
Le lundi 22 juin 2015 à 04:29 -0700, kcu a écrit :
> I have a doubt can we use gstdiscoverer on local files ?

Yes we can. Any reason to stick with GStreamer 0.10 ? It is very old
and unmaintained.

Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
kcu
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer DRM file detection

kcu
Ok. I tried giving the path of a local file as <folder_name>/<file_name> , discoverer returned Invalid URI, when I gave file name as file:///<folder_name>/<file_name> then it returned Discoverer Ok.Is there any other way to give file name?

There is no particular reason to stick with 0.10
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer DRM file detection

Nicolas Dufresne-3
Le lundi 22 juin 2015 à 21:21 -0700, kcu a écrit :
> Ok.Is there
> any other way to give file name?

It works with URI. You can build an URI in your code, glib has API for
that. In shell, gst-discover-1.0 file://$(pwd)/myfile.blabla

Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer DRM file detection

Nicolas Dufresne-3
In reply to this post by kcu
Le lundi 22 juin 2015 à 21:21 -0700, kcu a écrit :
> Ok. I tried giving the path of a local file as
> <folder_name>/<file_name> ,
> discoverer returned Invalid URI, when I gave file name as
> file:///<folder_name>/<file_name> then it returned Discoverer Ok.Is
> there
> any other way to give file name?
>
> There is no particular reason to stick with 0.10

Actually, in 1.0 it works with relative file path too. That could be a
good reason to move on ;-P

Nicolas

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
kcu
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer DRM file detection

kcu
Thanks,.. I will work on it.