my FileDescriptor doesn't work with mediaplayer (plz help)

by zeeshan » Fri, 26 Feb 2010 18:34:23 GMT


Sponsored Links
 Hi Experts,

i have a filedescriptor through a script like this
------------------------------------------------------------
Class<?> execClass = Class.forName("android.os.Exec");
                    Method createSubprocess =
execClass.getMethod("createSubprocess",
                            String.class, String.class, String.class,
int[].class);
                    Method waitFor = execClass.getMethod("waitFor",
int.class);

                    // Executes the command.
                    // NOTE: createSubprocess() is asynchronous.
                    int[] pid = new int[1];
                  FileDescriptor   fd =
(FileDescriptor)createSubprocess.invoke(
                            null, "/system/bin/cat", "/sdcard/chunk.3gp",
null, pid);
------------------------------------------------------------

i can read bytes from fd and it seems working fine but when i pass it
to the mediaplayer as datasource.
it doesn't show anything. (this is just 1 sec video)
same video works fine with direct path but i need to decrypt the file
bytes by bytes while its playing.
i thought this solution might help me but no luck so far.
can anybody guide me to the right direction how can i decrypt the file
while playing ?
or do i need to change in native code and build the opencore (pv
player ) separately and any change in there?

please help

--



my FileDescriptor doesn't work with mediaplayer (plz help)

by genxsol » Fri, 26 Feb 2010 18:34:28 GMT


 Hi Experts,

i have a filedescriptor through a script like this
------------------------------------------------------------
Class<?> execClass = Class.forName("android.os.Exec");
                    Method createSubprocess =
execClass.getMethod("createSubprocess",
                            String.class, String.class, String.class,
int[].class);
                    Method waitFor = execClass.getMethod("waitFor",
int.class);

                    // Executes the command.
                    // NOTE: createSubprocess() is asynchronous.
                    int[] pid = new int[1];
                  FileDescriptor   fd =
(FileDescriptor)createSubprocess.invoke(
                            null, "/system/bin/cat", "/sdcard/chunk.3gp",
null, pid);
------------------------------------------------------------

i can read bytes from fd and it seems working fine but when i pass it
to the mediaplayer as datasource.
it doesn't show anything. (this is just 1 sec video)
same video works fine with direct path but i need to decrypt the file
bytes by bytes while its playing.
i thought this solution might help me but no luck so far.
can anybody guide me to the right direction how can i decrypt the file
while playing ?
or do i need to change in native code and build the opencore (pv
player ) separately and any change in there?

please help

--


Sponsored Links


Other Threads

1. How do you avoid self notification when with ContentProviders

I've implemented a custom ContentProviders that calls notifyChange 
passing in null as the ContentObserver. There doesn't seem to be a way 
to pass a ContentObserver to a ContentProvider so that's the only option.


I would now like to avoid receiving self notifications for changes I 
make via my UI in order to avoid having to requery the database. In 
other words, I've implemented a scenario where I add some data via the 
UI which is then inserted into the ContentProvider. The UI is already 
aware of the new data so I don't want to get a change notification. 
Since the ContentProvider can't get a hold of my ContentObserver, the 
ContentObserver#deliverSelfNotifications mechanism doesn't work.
I tried setting a thread local boolean in my code, but the change 
notifications are delivered asynchronously via a binder thread so that 
doesn't work either.


Does anyone know of a way to avoid self (or detect) self notifications 
when using ContentProviders?


Regards,

Pepijn

--

2. push audio to caller on android

Is it possible in android to push an audio to the listener (caller) at
the other end without using phone's speaker ?

-- 

3. NFC Reader / Transmitter

4. Warnings when trying to implement Google docs functionality

5. Closed WTA: Paging Team Telkomsel

6. Beginner question about Imageviews and Layouts

7. How To Build a $10 Android Wind-Up Charger [DIY]