how to show yuv picture in android?

by jiangchd » Wed, 01 Apr 2009 01:11:00 GMT


Sponsored Links
 In cameraservice.cpp, it uses the following code to show picture in
format yuv420.

mSurface->registerBuffers(w,h,w,h,
                             PIXEL_FORMAT_YCbCr_420_SP,
                                  mHardware->getPreviewHeap());

But there's no color shown on the screen. It seems as that only luma
data was processed.

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



Other Threads

1. Problem setting an alarm and receiving it

Hey,

I have a class that sets an alarm and another class which is called
when the alarm goes off. When I try to compile the program, it says
there is an error in my application but it doesn't show me any
errors.

This is my manifest file :

====================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="gAlert.gAlert"
      android:versionCode="1"
      android:versionName="1.0.0">
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <activity android:name=".GCartoon"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="SetAV"></activity>
        <activity android:name="GAlarmReceiver"></activity>
        <receiver class=".GAlarmReceiver" />
        </application>
</manifest>

=====================================================

This is the class that receives the signal  :

=====================================================

package gAlert.gAlert;

import android.content.Context;
import android.content.Intent;
import android.content.BroadcastReceiver;
import android.widget.Toast;

public class GAlarmReceiver extends BroadcastReceiver {
        @Override
        public void onReceive(Context con, Intent in) {
                Toast.makeText(con, "One shot received", 
Toast.LENGTH_SHORT).show();
        }
}

=====================================================


This is the piece of code that tries to set the alarm:


=====================================================

                        Intent intent = new Intent(GAlert.this, 
GAlarmReceiver.class);
                        PendingIntent sender = PendingIntent.getBroadcast(this, 
0, intent,
0);



            // We want the alarm to go off 30 seconds from now.
            Calendar calendar = Calendar.getInstance();
            calendar.setTimeInMillis(System.currentTimeMillis());
            calendar.add(Calendar.SECOND, 30);

                        AlarmManager am = (AlarmManager) 
getSystemService(ALARM_SERVICE);
                        am.set(AlarmManager.RTC_WAKEUP, 
calendar.getTimeInMillis(),
sender);

                        if (mToast != null) {
                                mToast.cancel();
                        }
                        mToast.show();

======================================================


Am I doing anything wrong here? It seems like the error is probably in
my manifest file but I copied it from Android's documentation so I
don't know.

Thanks in advance for all the help.

Regards,
Moazzam
http://moazzam-khan.com/
--~--~---------~--~----~------------~-------~--~----~

2. setResult crashed if portrait/landscape orientation changes

I have this scenario:
1) activity A starts activity B via startActivityForResult.
2) User changes orientation which triggered activity B to be destroyed
and its onCreate method to be called a second time.
3) Activity B calls setResult(...) and that crashes.

It seems activity B no longer knows who to return to the result to.
Is it possible to save info into the Bundle via  onSaveInstanceState
so that activity B can remember who called it?
--~--~---------~--~----~------------~-------~--~----~

3. google-framework_intermediates directory missing when building on Handy heron

4. Mobile web and Android app integration

5. pre-portability number being returned from telephony manager

6. Threads in Android

7. Contacts Performance