src/app/transcode/basebranchfactory.cpp
void BaseBranchFactory::onNewDecodedPad(GstElement *decodebin,
                                        GstPad     *new_pad,   gboolean    last,
                                        gpointer    user_data) throw()
    try
    {
        BaseBranchFactory *holder =
            static_cast<BaseBranchFactory*>(user_data);
        BOOST_ASSERT(holder);

        // set pipeline in pause mode
        holder->pausePipeline();

        GstCaps* caps = gst_pad_get_caps (new_pad);
        BOOST_ASSERT(caps);
        gchar* str = gst_caps_to_string (caps);
        BOOST_ASSERT(str);

        klk_log(KLKLOG_DEBUG, "GST: new_decoded_pad_cb () caps: %s", str);
        /* video stream */
        if (g_str_has_prefix (str, "video/"))
        {
            holder->createVideoSink(new_pad);
        }
        /* audio stream */
        else if (g_str_has_prefix (str, "audio/"))
        {
            holder->createAudioSink(new_pad);
        }
        // set pipeline in playing mode
        holder->playPipeline();
    }
    catch(const std::exception& err)
    {
        klk_log(KLKLOG_ERROR, "Error in new_decoded_pad_cb(): %s", err.what());
    }
    catch(...)
    {
        klk_log(KLKLOG_ERROR, "Error in new_decoded_pad_cb():"
                " unknow exception");
    }
// new-decoded-pad signal was recieved
// This signal gets emitted as soon as a new pad
// of the same type as one of the valid 'raw' types is added.
// static
new-decoded-pad signal was recieved
This signal gets emitted as soon as a new pad
of the same type as one of the valid 'raw' types is added.
static
new - decoded - pad signal was recieved This signal gets emitted as soon as a new pad of the same type as one of the valid ' raw ' types is added . static
void BaseBranchFactory::onNewDecodedPad(GstElement *decodebin,
                                        GstPad     *new_pad,   gboolean    last,
                                        gpointer    user_data) throw()
    try
    {
        BaseBranchFactory *holder =
            static_cast<BaseBranchFactory*>(user_data);
        BOOST_ASSERT(holder);
        holder->pausePipeline();
        GstCaps* caps = gst_pad_get_caps (new_pad);
        BOOST_ASSERT(caps);
        gchar* str = gst_caps_to_string (caps);
        BOOST_ASSERT(str);
        klk_log(KLKLOG_DEBUG, "GST: new_decoded_pad_cb () caps: %s", str);
        if (g_str_has_prefix (str, "video/"))
        {
            holder->createVideoSink(new_pad);
        }
        else if (g_str_has_prefix (str, "audio/"))
        {
            holder->createAudioSink(new_pad);
        }
        holder->playPipeline();
    }
    catch(const std::exception& err)
    {
        klk_log(KLKLOG_ERROR, "Error in new_decoded_pad_cb(): %s", err.what());
    }
    catch(...)
    {
        klk_log(KLKLOG_ERROR, "Error in new_decoded_pad_cb():"
                " unknow exception");
    }
void BaseBranchFactory :: onNewDecodedPad ( GstElement * decodebin , GstPad * new_pad , gboolean last , gpointer user_data ) throw ( ) try { BaseBranchFactory * holder = static_cast < BaseBranchFactory * > ( user_data ) ; BOOST_ASSERT ( holder ) ; holder -> pausePipeline ( ) ; GstCaps * caps = gst_pad_get_caps ( new_pad ) ; BOOST_ASSERT ( caps ) ; gchar * str = gst_caps_to_string ( caps ) ; BOOST_ASSERT ( str ) ; klk_log ( KLKLOG_DEBUG , " " , str ) ; if ( g_str_has_prefix ( str , " " ) ) { holder -> createVideoSink ( new_pad ) ; } else if ( g_str_has_prefix ( str , " " ) ) { holder -> createAudioSink ( new_pad ) ; } holder -> playPipeline ( ) ; } catch ( const std :: exception & err ) { klk_log ( KLKLOG_ERROR , " " , err . what ( ) ) ; } catch ( ... ) { klk_log ( KLKLOG_ERROR , " " " " ) ; }
new-decoded-pad signal was recieved
This signal gets emitted as soon as a new pad
of the same type as one of the valid 'raw' types is added.
new - decoded - pad signal was recieved This signal gets emitted as soon as a new pad of the same type as one of the valid ' raw ' types is added .
// set pipeline in pause mode /* video stream */ /* audio stream */ // set pipeline in playing mode