Why the buffer is 0 when I play the "rtsp" movie from the internet?

by yjshi » Mon, 31 Aug 2009 19:35:13 GMT


Sponsored Links
 Why the buffer is 0 when I play the "rtsp" movie from the internet?
I wrote a appliaction to play the movie from the internet.I try many
times and could not found out the reason ,so I decided to have a look
at opencore source code.
I look at the opencore source code ,and I find that it is the most
important code is below.But I could not find out how the percentage is
increasing .So I could not find out where the reason caused all
these.could someone give me a hand?
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€void PlayerDriver::HandleInformationalEvent(const
PVAsyncInformationalEvent& aEvent)
{
......
 case PVMFInfoBufferingStatus:
            {
                const void *buffer = aEvent.GetLocalBuffer();
                const size_t size = aEvent.GetLocalBufferSize();
                int percentage;
                if (GetBufferingPercentage(buffer, size, &percentage))
                {

                    //This place print the log "D/PlayerDriver(   31):
buffering (0)"
                    LOGD("buffering (%d)", percentage);

                    mPvPlayer->sendEvent(MEDIA_BUFFERING_UPDATE,
percentage);
                }
            }
            break;
......

-----------------------------------------------------------------------------------------------------
bool GetBufferingPercentage(const void *buffer,
                            const size_t size,
                            int *percentage)
{
    if (buffer == NULL) {
                LOGI(" GetBufferingPercentage  Invalid buffer: NULL");
                LOGE("Invalid buffer: NULL");
        return false;
    }
    if (sizeof(int) != size)
    {
        LOGE("Invalid percentage buffer size %d (expected %d)", size,
sizeof(int));
        return false;
    }
    // TODO: The PVEvent class should expose a memcopy method
    // that does bound checking instead of having clients reaching
    // for its internal buffer.
    // Clamp the value and complain loudly.
    oscl_memcpy(percentage, buffer, sizeof(int));


    if (*percentage < 0 || *percentage > 100)
    {
        LOGE("Invalid percentage value %d", *percentage);
        return false;
    }
    return true;
}
____________________________________________________________-
log
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)

while play the "http" movie ,it's ok;
and now I don't konw where the percentage is not increasing ,and how
the percentage is increasing.
--~--~---------~--~----~------------~-------~--~----~



Why the buffer is 0 when I play the "rtsp" movie from the internet?

by yjshi » Mon, 31 Aug 2009 19:37:19 GMT


 Why the buffer is 0 when I play the "rtsp" movie from the internet?
I wrote a appliaction to play the movie from the internet.I try many
times and could not found out the reason ,so I decided to have a look
at opencore source code.
I look at the opencore source code ,and I find that it is the most
important code is below.But I could not find out how the percentage is
increasing .So I could not find out where the reason caused all
these.could someone give me a hand?
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€void PlayerDriver::HandleInformationalEvent(const
PVAsyncInformationalEvent& aEvent)
{
......
 case PVMFInfoBufferingStatus:
            {
                const void *buffer = aEvent.GetLocalBuffer();
                const size_t size = aEvent.GetLocalBufferSize();
                int percentage;
                if (GetBufferingPercentage(buffer, size, &percentage))
                {

                    //This place print the log "D/PlayerDriver(   31):
buffering (0)"
                    LOGD("buffering (%d)", percentage);

                    mPvPlayer->sendEvent(MEDIA_BUFFERING_UPDATE,
percentage);
                }
            }
            break;
......

-----------------------------------------------------------------------------------------------------
bool GetBufferingPercentage(const void *buffer,
                            const size_t size,
                            int *percentage)
{
    if (buffer == NULL) {
                LOGI(" GetBufferingPercentage  Invalid buffer: NULL");
                LOGE("Invalid buffer: NULL");
        return false;
    }
    if (sizeof(int) != size)
    {
        LOGE("Invalid percentage buffer size %d (expected %d)", size,
sizeof(int));
        return false;
    }
    // TODO: The PVEvent class should expose a memcopy method
    // that does bound checking instead of having clients reaching
    // for its internal buffer.
    // Clamp the value and complain loudly.
    oscl_memcpy(percentage, buffer, sizeof(int));


    if (*percentage < 0 || *percentage > 100)
    {
        LOGE("Invalid percentage value %d", *percentage);
        return false;
    }
    return true;
}
____________________________________________________________-
log
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)

while play the "http" movie ,it's ok;
and now I don't konw where the percentage is not increasing ,and how
the percentage is increasing.
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. why we need to develop android app when iphone app runs on android

Uh.. first of all.. if the game is web based, then it plays on pcs, macs,
linux, iphones, etc .. is that right? How would you even bother trying to
write it for android specifically if the game was already web based? I am
unclear as to why/how you decided to spend all this time building android
specific game if the games of your company are already web based in the
first place? Can you elaborate on that a bit?

As for android specific games.. I think it really depends on what you're
trying to do. I am pretty sure a 2D/3D game using the apis will look
smoother/better on android than a web based game on the android browser.
Until Flash is supported at least..but even then, I am guessing you will be
extremely limited with flash based games to do lots of hardware things like
audio mixing of lots of sounds and music, high end 3D, even high end 2D high
frame rates? I am not entirely sure, I've not done any flash stuff, but I
would think the apis for the device are going to give a lot more performance
than flash via the mobile web?





> 

2. android:fastScrollEnabled="true": Is there more to getting the alphabetical index?

Hi Guys,

I added android:fastScrollEnabled="true" to the xml description of my
listview class.
I was (probably mistakenly) expecting this to magically transform the
scrolling of my
really huge listview so that the thumb button and the indexes display
on the right side.

Is there more to hooking up the listview so that the framework knows
what its alphabetizing?
I have custom defined cells.

If anyone knows, or knows a good example, please let me know.

Thanks!!

pawpaw17

-- 

3. why we need to develop android app when iphone app runs on android

4. Paging boss Rendra tulungagung

5. getting notified on documents change

6. US Taxes: Does Google send a 1099 tax form?

7. list - need suggestion