鈼廇bout AndroidSurfaceOutput use PVPlayer as parameter in cupcake

by hanchao3c » Tue, 20 Jan 2009 06:54:52 GMT


Sponsored Links
 In Cupcake branch:

The constructor of AndroidSurfaceOutput add a paramether PVPlayer. It
mean AndroidSurfaceOutput need know who is using this output.

path : external/opencore/android/android_surface_output.cpp
in about 1041
===============================================
    // update app
    mPvPlayer->sendEvent(MEDIA_SET_VIDEO_SIZE, displayWidth,
displayHeight);
===============================================

The displayWidth and displayHeight is the display size  set by
AndroidSurfaceOutput::setParametersSync.

It mean when the displaysize is  set , The AndroidSurfaceOutput need
notify the PVPlayer.
I have 3 question about it :
1.  AndroidSurfaceOutput is designed a passive output , so it looks
strange .

2.  In original design PVPlay will decode using the video size ,
AndroidSurfaceOutput work as output device , it may resize it to
display size.
So when PVPlay need know the display size ?
Do it only used by mediaplayer App ?

3. If the Surface is using hardware overlay , Does it has something
different for it ?






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



鈼廇bout AndroidSurfaceOutput use PVPlayer as parameter in cupcake

by hanchao3c » Tue, 20 Jan 2009 07:04:07 GMT


 I only can think it as the :
The set display size and the true display size may be not same .  (For
some pixel format it need use 4 bytes or 2 bytes)
So the Output need notify the PVPlayer .

Does it only for it? or has other meaning ?

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


Sponsored Links


鈼廇bout AndroidSurfaceOutput use PVPlayer as parameter in cupcake

by Freepine » Tue, 20 Jan 2009 07:46:39 GMT


 It seems android guys are doing some refactoring:)And you can find in latest
master branch, they even changed AndroidSurfaceOutput from constructor
injection to setter injection. But it seems AndroidSurfaceOutput isn't an
interface? I am really curious what below code is prepared for :)
 @@ 
-582,8< http://android.git.kernel.org/?p=platform/external/opencore.git ;a=blob;f=android/playerdriver.cpp;h=72320ef33a43b5ff0b53db35265a99ed09625569#l582>
+595,32< http://android.git.kernel.org/?p=platform/external/opencore.git ;a=blob;f=android/playerdriver.cpp;h=31f1a1e84a78e8fc15fb81ec8f0a7ed3b76dd463;hb=71652749e2899efc5c108511a1e74399d72fd6e4#l595>@@
 void PlayerDriver::handleInit(PlayerInit* ec)
 void PlayerDriver::handleSetVideoSurface(PlayerSetVideoSurface* ec)
 {
     int error = 0;
+    AndroidSurfaceOutput* mio = NULL;
+
+    // attempt to load device-specific video MIO
+    if (mLibHandle != NULL) {
+        VideoMioFactory f = (VideoMioFactory) ::dlsym(mLibHandle,
VIDEO_MIO_FACTORY_NAME);
+        if (f != NULL) {
+            mio = f();
+        }
+    }
+
+    // if no device-specific MIO was created, use the generic one
+    if (mio == NULL) {
+        LOGW("Using generic video MIO");
+        mio = new AndroidSurfaceOutput();
+    }
+
+    // initialize the MIO parameters
+    status_t ret = mio->set(mPvPlayer, ec->surface());
+    if (ret != NO_ERROR) {
+        LOGE("Video MIO set failed");
+        commandFailed(ec);
+        delete mio;
+        return;
+    }
+    mVideoOutputMIO = mio;

-    mVideoOutputMIO = new AndroidSurfaceOutput(mPvPlayer, ec->surface());
     mVideoNode =
PVMediaOutputNodeFactory::CreateMediaOutputNode(mVideoOutputMIO);
     mVideoSink = new PVPlayerDataSinkPVMFNode;

2009/1/20 hanchao3c <hancha...@gmail.com>


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



鈼廇bout AndroidSurfaceOutput use PVPlayer as parameter in cupcake

by Freepine » Tue, 20 Jan 2009 07:50:08 GMT


 oh, maybe below line should be changed to PvmiMIOControl*? maybe I missed
something...
+    AndroidSurfaceOutput* mio = NULL;
+

2009/1/20 Freepine <freep...@gmail.com>


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



鈼廇bout AndroidSurfaceOutput use PVPlayer as parameter in cupcake

by hanchao3c » Tue, 20 Jan 2009 07:55:20 GMT


 It seem video MIO has add a new impl too

I think Spark should know it .


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



鈼廇bout AndroidSurfaceOutput use PVPlayer as parameter in cupcake

by Freepine » Tue, 20 Jan 2009 11:53:20 GMT


 oh? for hardware overlay?

2009/1/20 hanchao3c <hancha...@gmail.com>


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



鈼廇bout AndroidSurfaceOutput use PVPlayer as parameter in cupcake

by Dave Sparks » Tue, 20 Jan 2009 16:24:19 GMT


 Yes, we are providing hardware abstraction for video sink and adding
support for video overlays.



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



鈼廇bout AndroidSurfaceOutput use PVPlayer as parameter in cupcake

by Archer » Mon, 26 Jan 2009 19:43:03 GMT


 Hi Dave,

Is there any new update about this hardware abstraction? Is it
available soon?

So right now, by default the generic MIO is being used. then is
hardware accelerated rendering (and color conversion) still enabled
with generic MIO? Or it is completely independent?

Thanks,
Archer




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



鈼廇bout AndroidSurfaceOutput use PVPlayer as parameter in cupcake

by Dave Sparks » Mon, 26 Jan 2009 20:14:03 GMT


 I just checked in a change into our internal tree this morning that
moves just a few functions that are specific to the pmem
implementation into a separate subclass. This change should be go out
in the next batch migration within 2-3 days.

With this change, the generic MIO will use the OpenCore codecs, color
convert to RGB565 and push the buffers to SurfaceFlinger. It also
falls back to this behavior if you are running device specific code in
the emulator.

If you want a hardware specific module, you create a subclass of
AndroidSurfaceOutput and a factory function to create it and include
it in a new library called "libopencorehw.so". When PlayerDriver
constructs the video MIO, it dlopen's the hardware library and calls
the factory function to create the MIO. If any of those steps fails,
it falls back to the generic MIO.





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



鈼廇bout AndroidSurfaceOutput use PVPlayer as parameter in cupcake

by Archer » Mon, 26 Jan 2009 23:10:30 GMT


 Thank you for the response, Dave.

If I compile the cupcake for G-1, how do I turn on the hardware
accelerated open GL? It seems that the file libhgl.so has to be copied
from an existing phone and added to the compiled image. Are there
anything else need to be done?

Thanks,
Archer






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



鈼廇bout AndroidSurfaceOutput use PVPlayer as parameter in cupcake

by Dave Sparks » Tue, 27 Jan 2009 03:50:49 GMT


 I'm not familiar with the process - our internal development is
different, so it hasn't been something I've had to worry about.

Maybe someone else can help?







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



Other Threads

1. Can't display GoogleMaps in application

Hi guys,

I'm trying to display GoogleMaps in my application, but instead of map
I just get an empty screen with crosses and Google logo in the bottom
left corner.

I'm using Internet permission in manifest file, just as the library
"com.google.android.maps". I have also supported my application with
Android Maps API key and I placed it in layout as android:apiKey value
for MapView, but it still can't display the map.

main.xml:

<com.google.android.maps.MapView
        android:id="@+id/myMapView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:enabled="true"
        android:clickable="true"
        android:apiKey="07vNiwHa094tV14bUdyK0VTtXx0eeAZlk6WdKXQ"
/>

manifest.xml:

<uses-library android:name="com.google.android.maps" />
...
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION" />


I have used two different apiKey values, regarding whether I signed
the application with debug or my own created keystore, but it didn't
work with none of them.

If someone can help me, I would really appreciate it.


Best regards,
Alex


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

2. Problem: Holding the Home button, and powering on the device doesn't send me into recovery mode.

Trying to apply a manual update to my phone, and can't get the phone
to go into recovery mode.

I have tried all sorts of permutations of holding down the power and
home buttons on startup (holding them both, holding home, and
releasing power, pressing power, then holding both, etc).  I have been
trying for about an hour.

All that happens is I get the G1 flash screen (and the vibrate), and
it flashes, then repeats (until I release the buttons at which point
it boots normally).

I am in the middle of updating the phone, so I can get root.  I think
I have successfully completed the rooting (I have downgraded to RC29
successfully, and applied the telnet commands).

(I think my trouble getting to recovery mode isn't related to my
rooting process, but wanted to make full disclosure)

I ran through this procedure to manually update to Cupcake a few
months ago, and it worked fine.  I have no idea why I can't get to
recovery more now!  Help, I really want to successfully flash some of
the latest ROMs (which is why I am going through this in the first
place), and obviously can't do this without recovery mode.

BTW, I confirmed I do have a Update.zip file in the root of my SDCARD
(but suspect that even if I didn't I should still be able to enter
recovery mode).
--~--~---------~--~----~------------~-------~--~----~

3. Set Background color for custom dialog title ??

4. streaming video / remote rendering sample?

5. Wed service

6. Availability of Developer Phone Try 2

7. Pausing VideoView when launching a new intent...