how to integrate a mjpeg decoder into open core framework

by dadaowuwei » Fri, 23 Apr 2010 08:05:47 GMT


Sponsored Links
 Hi,
I am quite new for android onpencore framework and have some
questions  for integrating process of a new openmax mjpeg component

1. can I directly inherit the omx_component_video class to form my own
mjpeg component?
2. how pvmf consumes the output buffer of the component, what kind of
decoded data should i put onto the output buffer so that these data
will be recognized by pvmf and played (this helps me to design my
decoder)
3. when pvmf  first sends fillthisbuffer command to component,I wonder
how pvmf could indicate the component where the file is?
4. If the file needs to be serialized before filling in the input
buffer and who serialize it component or pvmf?

thank you very much,
Best Regards,

Dadao

--



Other Threads

1. misbehaving grid (not aligning properly with multi-line text and image)

Hi there,

Please take a look at:
http://kombadil.willflow.com/misbehaving_grid/

The grid starts out OK, but if you move around, the alignment is
messed up. Any suggestions?

Thanks!

Ken

P.S. I've attached the code below:

----- main.xml -----
<?xml version="1.0" encoding="utf-8"?>

<GridView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/launch_grid"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
    android:padding="10dip"
    android:verticalSpacing="10"
    android:horizontalSpacing="10"
    android:numColumns="auto_fit"
    android:columnWidth="60"
    android:stretchMode="columnWidth"

    android:gravity="center"
/>

----- ThreadTest.java -----
package com.test.threadtest;

import java.io.BufferedInputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;

public class ThreadTest extends Activity {
        private List<Icon> icons;
        private GridView launchView;
        private IconListAdapter iconListAdapter;

        @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.main);
        final Handler mHandler = new Handler();
        icons = new ArrayList<Icon>();

        Thread t = new Thread() {
                        public void run() {
                                perform();
                                mHandler.post(mUpdate);
                        }
                };

                t.start();
    }

    protected void perform() {
        ServerHandler serverHandler = new ServerHandler();
        icons = serverHandler.getIcons();
        iconListAdapter = new IconListAdapter(this, icons);

        }

    final Runnable mUpdate = new Runnable() {
        public void run() {
                launchView = (GridView) findViewById(R.id.launch_grid);
                launchView.setAdapter(iconListAdapter);
                launchView.setOnItemClickListener(new OnItemClickListener() {
                        public void onItemClick(AdapterView parent, View v, int
position, long id) {
                                Intent i = new Intent(ThreadTest.this, 
ThreadTest.class);
                                startActivity(i);
                        }
                });


        }
    };

    public class IconListAdapter extends BaseAdapter {
        private Context ctx;
        private List<Icon> icons;

                public IconListAdapter(Context ctx, List<Icon> icons) {
                        this.ctx = ctx;
                        this.icons = icons;
        }

        public View getView(int position, View convertView, ViewGroup
parent) {
                Icon app = icons.get(position);
                ApplicationView av = new ApplicationView(ctx, app.name,
app.iconUrl);
                return av;
        }

        public final int getCount() {
            return icons.size();
        }

        public final Object getItem(int position) {
            return icons.get(position);
        }

        public final long getItemId(int position) {
            return position;
        }
    }

    public static Bitmap getBitmap(String urlString) {
                Bitmap bm = null;

                if (urlString.startsWith("http")) {
                        try {
                                URL url = new URL(urlString);
                                HttpURLConnection conn = (HttpURLConnection)
url.openConnection();
                                conn.connect();
                                InputStream is = conn.getInputStream();
                                BufferedInputStream bis = new 
BufferedInputStream(is);
                                bm = BitmapFactory.decodeStream(bis);
                                conn.disconnect();
                                is.close();
                                bis.close();
                        } catch (Exception e) {
                                Log.e("error", e.toString());
                                bm = null;
                        }
                }

                return bm;
        }

        public class ApplicationView extends LinearLayout {
                private TextView name;
                private ImageView icon;

                public ApplicationView(Context context, String name, String
urlString) {
                        super(context);
                        this.setOrientation(VERTICAL);

                        this.icon = new ImageView(context);
                        addView(icon, new
LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
                        this.icon.setImageBitmap(getBitmap(urlString));

                this.name = new TextView(context);
                        addView(this.name, new
LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
                        this.name.setText(name);
                }
        }
}


----- ServerHandler.java -----
package com.test.threadtest;

import java.util.ArrayList;
import java.util.List;

import android.util.Log;

public class ServerHandler {
        public List<Icon> getIcons() {
                final List<Icon> icons = new ArrayList<Icon>();

                String name = "icon";

                for(int i=0; i<10; i++) {
                        Icon icon = new Icon();
                        icon.name = name;
                        name += "xxx";
                        icon.iconUrl = "http://code.google.com/android/images/
logo_android.gif";
                        icons.add(icon);
                }

                // Sleep code
                // Comment this section out and the code would work.
                // In reality it is a piece of code that talks to a server.
//              try {
//                      Log.e("test", "enter");
//                      Thread.sleep(1000);
//                      Log.e("test", "leave");
//              } catch (InterruptedException e) {
//                      e.printStackTrace();
//              }

                return icons;
        }
}



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

2. How to add track file in /data/misc/location folder to enable mock gps

Or is there any other way to handle gps to show different location
navigation at runtime (there could be menu, on choose of location I
want to see the location movement).

How to use gps using class file? can anyone provide the example or
sample code?

I would really appreciate your help.
Thanks,
Niket



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

3. Calling to phone from System

4. GTalk connection very slow?

5. How to add track file in /data/misc/location folder to enable mock gps

6. 绛斿: [android-beginne rs] How to make a service started when the OS sets up?

7. R: Android on Nokia E90