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. Turning off Android notifications.(Battery/Bluetooth)

Hi,

My first question is about low battery notification. I would like turn
off this popup which oocurs when battery is low during my application
is on. I can catch of course Intent.ACTION_BATTERY_LOW but additionaly
Android show me this popup. Is it possible to turn it off?

Second topic is about turning on bluetooth. When I turn it on using
API system show me additional popup asking if I agree to turn on
bluetooth module by this application. Is it possible to turn off this
popup. I have HTC Legend on which popup occures and my friend has
Motorola Milestone on which it doesn't occur. So probably it's only in
HTC Andoid implementation.


regards,
Pobudzio

-- 

2. Problem with icons of Menu items

Hi,
  I have a problem with showing icons for menu items. The items which appear
when I click on menu button are having icons but When I click on "More"
option in Menu, The newly shown menu items are not having any icons even
though I have set the icons for these items in my xml.

Thanks,
Shashidhar

-- 

3. Black spinner in progressbar

4. Wrong format from String.format()

5. Error during sms deletion.

6. MatrixCursor accross process impossible to parceleable.

7. Problems with library projects