Animation of the videoView in Android 2.2 is not working

by Shiva bhole » Fri, 20 May 2011 09:34:05 GMT


Sponsored Links
 Dear all,

I want to know how can we animate the video. I tried animating the
Image using the ImageView and it happened very smoothly. But, when I
try to animate the VideoView using the animation class, I am able to
move the view only (can see a black screen moving) but our video is
played in the same position.

Can anyone please explain how we can implement it?

TIA

SB

-- 



Other Threads

1. Why Surface postBuffers doesn't work fine sometimes, thanks your reply

Hi friends,
    I am using SurfaceView to render a image buffer.
    The image buffer is generated by a interval timer,  what I need to
do is to show the image data in phone.

    Surface can finish this work,  the following is my steps to show
the image.

    in java layer, create a view, which will driver from SurfaceView,
and get the created surface, set the type as
SURFACE_TYPE_PUSH_BUFFERS, pass the surface to JNI.

    then register two buffer to this surface,  when the data is
coming, will copy the image data to the framebuffer and do postBuffer.

    I am puzzled, sometimes it works fine, sometimes no image show.

static void android_media_Player_setSurface(JNIEnv *env, jobject thiz)
{

    jobject surface = env->GetObjectField(thiz, fields.surface);
    sp<ISurface> iSurface=NULL;
    if (surface != NULL)
    {
        const sp<Surface>& native_surface = get_surface(env, surface);
        iSurface = native_surface->getISurface();
        if (iSurface == m_iSurface) {
            return;
        }
        m_iSurface.clear();
        m_frameHeap.clear();
    }
    m_iSurface = iSurface;

    if (m_iSurface.get())
    {
        //RGB-565 frames are 2 bytes/pixel
        const sp<Surface>& native_surface = get_surface(env, surface);
        int x=0; int y=0; int w=0; int h=0; int freeze=0;
        m_iSurface->getSurfaceInformation(x, y, w, h, freeze);

        m_heigh = h;
        m_width = w;

        //double buffer
        int frameSize = w * h * 2 * 2;
        m_frameHeap = new android::MemoryHeapBase(frameSize);
        if (m_frameHeap->heapID() < 0) {
            return;
        }

        android::ISurface::BufferHeap buffers(w, h, w, h,
android::PIXEL_FORMAT_RGB_565, m_frameHeap);
        android::status_t ret = m_iSurface->registerBuffers(buffers);

        m_frameBufferOffset = 0;
    }
}

Here is to postBuffers, called by image generation program, we just
copy the whole region
void postBuffer(unsigned char * idata, int offset, int iLen)
{
    if(m_iSurface.get())
    {
        unsigned char* frameAddr = static_cast<unsigned char*>
(m_frameHeap->base());
        if(frameAddr != NULL)
        {
                if(m_frameBufferOffset == 0)
                {
                    m_frameBufferOffset = m_width * m_heigh*2;
                }
                else
                {
                    m_frameBufferOffset = 0;
                }
                memcpy(frameAddr + m_frameBufferOffset, idata-offset,
m_width * m_heigh * 2);

                m_iSurface->postBuffer(m_frameBufferOffset);
        }
    }
}


Thanks
Huadong

--~--~---------~--~----~------------~-------~--~----~

2. trouble sending an mms

I am trying to send an MMS message like this --

        Intent sendIntent = new Intent(Intent.ACTION_SEND);
        sendIntent.putExtra("sms_body", "hello world");
        sendIntent.setType("vnd.android-dir/mms-sms");
        sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File
(url)));  // I have tried Uri.parse(url) here
        sendIntent.setType("image/*");   // I have tried "image/jpg" and
"impage/jpeg" here...
        startActivity(sendIntent);

The file that I'm trying to send is in my application sandbox.

/data/data/com.myapp.test/files/myco/cache/1234.jpg

However, every time I send the message, I get --

10-16 01:46:51.371: ERROR/MediaModel(3298): IOException caught while
opening or reading stream
10-16 01:46:51.371: ERROR/MediaModel(3298):
java.io.FileNotFoundException: /data/data/com.myapp.test/files/myco/
cache/1234.jpg
10-16 01:46:51.371: ERROR/MediaModel(3298):     at
org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:
231)
10-16 01:46:51.371: ERROR/MediaModel(3298):     at
java.io.FileInputStream.<init>(FileInputStream.java:80)

Is this because the file I'm pointing at is in my local sandbox?  And
if it is, how do I expose it to the MMS app.  I have thought about
copying it to the SD card first, but that seems like a really bad
solution...

Can I have the intent run as thought the person who received it is
me?  (I thought I remembered reading that somewhere...)

tia.
--~--~---------~--~----~------------~-------~--~----~

3. BOOT_COMPLETED not being received by my application since 1.6

4. Streaming realtime video from the phone, not too the phone need

5. Download Hide My Ip 2009 And Key

6. Opencore ASF file support

7. verifyError with maps add-on