Exemple #1
0
static int mls_get_stream_info(void* data, int streamIndex, const StreamInfo** streamInfo)
{
    MultipleMediaSources* multSource = (MultipleMediaSources*)data;
    MediaSourceElement* ele = &multSource->sources;
    int maxIndex = 0;
    int minIndex = 0;
    int result;

    while (ele != NULL && ele->source != NULL)
    {
        maxIndex += ele->numStreams;
        if (streamIndex < maxIndex)
        {
            result = msc_get_stream_info(ele->source, streamIndex - minIndex, streamInfo);

            /* force picture aspect ratio if neccessary */
            if (result &&
                (*streamInfo)->type == PICTURE_STREAM_TYPE &&
                (multSource->aspectRatio.num > 0 && multSource->aspectRatio.den > 0))
            {
                ((StreamInfo*)(*streamInfo))->aspectRatio = multSource->aspectRatio;
            }
            return result;
        }
        minIndex = maxIndex;

        ele = ele->next;
    }

    return 0;
}
Exemple #2
0
int msc_get_id(MediaSource* source, int* sourceId)
{
    const StreamInfo* streamInfo;
    if (msc_get_num_streams(source) <= 0 || !msc_get_stream_info(source, 0, &streamInfo))
    {
        return 0;
    }
    
    *sourceId = streamInfo->sourceId;
    return 1;
}
Exemple #3
0
static int cps_get_stream_info(void* data, int streamIndex, const StreamInfo** streamInfo)
{
    ClipSource* clipSource = (ClipSource*)data;

    return msc_get_stream_info(clipSource->targetSource, streamIndex, streamInfo);
}