[webkit-dev] How can I get some debug infomation in MediaPlayerPrivateGStreamer.cpp

ZiQiangHuan hzqhuan at gmail.com
Thu Apr 19 23:08:39 PDT 2012


hi Terry,

In fact, I do something like this below:

MediaPlayerPrivateInterface*
MediaPlayerPrivateGStreamer::create(MediaPlayer* player)
{
    printf("MediaPlayerPrivateGStreamer::create(MediaPlayer* player) is
called\n");// added by zqhuan
    return new MediaPlayerPrivateGStreamer(player);
}

void MediaPlayerPrivateGStreamer::registerMediaEngine(MediaEngineRegistrar
registrar)
{

printf("MediaPlayerPrivateGStreamer::registerMediaEngine(MediaEngineRegistrar
registrar)\n");//added by zqhuan
    if (isAvailable())
        registrar(create, getSupportedTypes, supportsType);
}

bool MediaPlayerPrivateGStreamer::isAvailable()
{
    printf("isAvailable() is called\n"); //added by zqhuan
    if (!doGstInit())
        return false;

    GstElementFactory* factory = gst_element_factory_find("playbin2");
    if (factory) {
        gst_object_unref(GST_OBJECT(factory));
        return true;
    }
    return false;
}

but when I test with this, got nothing output.

And then, I add ASSERT(false) after the printf statement in
registerMediaEngine function, I can see the output:
MediaPlayerPrivateGStreamer::registerMediaEngine(MediaEngineRegistrar
registrar)
isAvailable() is called

I don't know why this happen. Any ideas?

Best regards,
zqhuan



在 2012年4月20日 上午11:35,Terry Anderson <tdanderson at google.com>写道:

> Are you sure that the code is even being reached? Try an ASSERT(false); to
> make sure.
>
> Terry
> On Apr 19, 2012 7:42 PM, "ZiQiangHuan" <hzqhuan at gmail.com> wrote:
>
>> hi,
>>
>> I build webkit with gstreamer support, but  I encountered a problem when
>> I test with it. When I write a simple statement "printf("*****\n")" in the
>> function isAvailable() of MediaPlayerPrivateGStreamer.cpp, I got nothing
>> output. When I do the same thing with the function create of
>> MediaPlayerPrivateGStreamer.cpp, I got nothing output too. So I want to
>> know if I want to get some debug info in these functions, what should I do?
>> anyone has some experience with this? And I don't know why this happen.
>>
>> Any help would be appreciated.
>>
>> Best regards,
>> zqhuan
>>
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120420/4fbefd61/attachment.html>


More information about the webkit-dev mailing list