344 Commits

Author SHA1 Message Date
Marco Nelissen
f51f1bd9d4 Verify we actually have valid utf8 metadata
Before calling NewStringUTF, check that the metadata value is actually
valid utf-8, and replace the offending characters with "?" if it is not.
b/5534491

Change-Id: I43de4307e739ae0b7d4177937ed33aa1dfb90d98
2011-11-03 13:12:16 -07:00
Jamie Gennis
f76afc80d2 MediaPlayer: properly handle released surfaces
Bug: 5396571
Change-Id: I6af87cb04f09f9ae6ea77cd7ba31108a3e93d24a
2011-10-14 19:55:12 -07:00
Marco Nelissen
8dc208476f Log a warning when a MediaPlayer is finalized without having being released.
b/5382634

Change-Id: I756d09d16a92ab8ce736c16a24e319a87be6c8de
2011-09-28 09:21:11 -07:00
James Dong
07b9ae3312 Add QVGA resolution to CamcorderProfile
Change-Id: Icebbafb68d8164370f98a2c36699845d10ef081b
related-to-bug: 5145483
2011-09-19 19:32:26 -07:00
Gloria Wang
81b37d8bde If media player has died already, do not dec the old surface texture reference.
Otherwise segfault will occur.
For bug 5327664.
Do not merge.

Change-Id: I03ea7bc047aa99a106f1e010dac74f75a833ef84
2011-09-15 15:38:36 -07:00
Gloria Wang
c286b2cc26 Cherry-pick from master. Do not merge.
Do not need to reset surface as NULL in MediaPlayer's _release.
Related to bug 5252296.

Change-Id: Ieab063cee70e072fcc4d861abe0f7979a7bab1ec
2011-09-15 11:58:25 -07:00
Chih-Chung Chang
a18886ca08 Fix 5278371: OOM in MediaItemThumbnailTest
Because we request 400x240 thumbnails. 100 thumbnails needs 38M,
which is too much. Change it to 70 now.

Also handle the case if the thumbnail callback throws exception.

Change-Id: Iac4ee72f308b7c7a6ae860983197601cf89bee8f
2011-09-09 13:58:59 +08:00
Chih-Chung Chang
47a52158d2 Fix 5156702: rotate thumbnails
Change-Id: I97b51dadf129172d5b154e9dfd66da254e4559d7
2011-09-07 19:20:45 +08:00
Dave Burke
fc301b0bb5 Require INTERNET permission for network-based content.
Bug #1870981

Change-Id: Ia3ad166390c4d60cea19c3783895b078a2c4c15f
2011-09-02 11:26:59 +01:00
Rajneesh Chowdury
c847b1a89d Fix for 5156702 Rotate video output for thumbnails and export
This is part of a multi project submit.
This is the Java and Jni changes.

Change-Id: I8851f5d865e657b7846bcded38e752f388f95895
2011-08-30 12:44:44 -07:00
Rajneesh Chowdury
3ced044154 Fix for 4142219 Don't hard code platform-specific limitations (Jni/ Java)
Also fixes 5118207 add other video codec support for video editor export.

Change-Id: If72427173bd8ff684af07ba00f4425c1deef29c6
2011-08-19 14:34:47 -07:00
Chih-Chung Chang
7f639d3315 Merge "Fix 5144356: Native crash while importing music" 2011-08-18 18:39:01 -07:00
Rajneesh Chowdury
a91495d56d Merge "Fix for 5155561 During export, progress bar jumps from 0 to 50%" 2011-08-18 09:09:35 -07:00
Chih-Chung Chang
176dde85a0 Fix 5144356: Native crash while importing music
1. Use the correct Get*Field functions according to the field type.
2. When we have exceptions, return.

Change-Id: I1878d806e26798a0977ff71a781551088e45f6fb
2011-08-18 15:28:43 +08:00
Rajneesh Chowdury
6721d33fef Fix for 5155561 During export, progress bar jumps from 0 to 50%
Change-Id: I5f5814a1212cd242535ae7cadec8a76f099e78ce
2011-08-17 16:12:39 -07:00
Chih-Chung Chang
1f5de3833d Display thumbnails one by one and cache them.
Change-Id: I10808f5bca475aea924817bf532dc5916438563a
2011-08-16 16:48:43 +08:00
Chih-Chung Chang
cb04a1f3a3 Speed up thumbnail generation.
We don't need to have precise position for thumbnails, so we add
a tolerance parameter to the decoder. The decoder can return an
earlier frame within the tolerance time given.

Change-Id: I0a49ed6b03f8c3264606e4143dd5ecf48e9d0f62
2011-08-15 10:08:33 +08:00
James Dong
65de903a88 Merge "If release has been called before finalize, do not expect MediaPlayer still exists" 2011-08-12 16:41:56 -07:00
James Dong
43ef913815 If release has been called before finalize, do not expect MediaPlayer still exists
o also, we should releae the surface object when release is called, not wait until finalize is called.

related-to-bug: 5157956

Change-Id: I0233ad61d8349c3e3800de68b752b9548ece1742
2011-08-12 16:39:47 -07:00
Eric Laurent
c498ad6eac Merge "Fix issue 5144429: CTS test fails for AudioEffects" 2011-08-12 12:49:42 -07:00
Ted Bonkenburg
1ee60119c4 Remove ParcelSurfaceTexture and update MediaPlayer
This removes the ParcelSurfaceTexture class since that functionality has been
folded into Surface.java. The change also updates the MediaPlayer to get rid
of setParcelSurfaceTexture() and modifies setTexture() to use the new Surface
functionality in order to simplify the code.

Change-Id: Iafa75ea3188263928128325d8a726786971b4de4
2011-08-11 19:58:25 -07:00
Eric Laurent
09f1735fad Fix issue 5144429: CTS test fails for AudioEffects
android_media_AudioEffect_native_setup() was not initializing
properly the effect descriptor for audio pre processings.

AudioEffect tests should create per processing effects on a valid
AudioRecord session.

Change-Id: Ia1862ca91c98e272f9374b9225a7d4ce7ef132fc
2011-08-11 18:06:18 -07:00
Gloria Wang
91784c996f To support for switching from a non-null surface/ surface texture to
a null one, and vice versa.
Fix for bug 5137445.

Change-Id: Ifca2997f8ad27a843abbdaa7e89a56329bc40fde
2011-08-09 15:31:30 -07:00
Chih-Chung Chang
17cfcbfa29 Add dependencies for the YV12 color converter change.
Bug: 5061733
Change-Id: Id8227a4f634285323c37498604fe080d986bfb09
2011-07-27 09:18:26 +08:00
Pannag Sanketi
85a315b547 Merge "Fixing up Mediarecorder for MFF" 2011-07-26 15:57:17 -07:00
Chih-Chung Chang
b33d46cc77 Merge "Add filename and line number in the debug messages." 2011-07-25 18:36:57 -07:00
Pannag Sanketi
cac873bd4a Fixing up Mediarecorder for MFF
For using the MediaRecorder in MFF (Mobile Filter Framework),
getMediaRecorder method in mediarecorder jni was earlier changed to
a non static method. Changed it back to a static method.

Also, added a new source type to MediaRecorder.VideoSource for recording
GRalloc buffers.

Change-Id: I031fad45c12b0ac9602d9e451d4767e95a86234d
2011-07-25 17:38:15 -07:00
Eric Laurent
0f7f4ece1b Added APIs for audio preprocessing
Added APIs to control pre processes applied on captured audio.
Those APIs are still hidden until reviewed by API council.

Three types of standard pre processes are supported:
- Automatic Gain Control (AGC) by AutomaticGainControl class
- Acoustic Echo Cancellation (AEC) by AcousticEchoCanceler class
- Noise Suppression (NS) by NoiseSuppressor class

A method is added to AudioEffect class to query audio pre processings
applied by default by the platform on a given AudioRecord session ID.

Change-Id: I0b9fceeb8c704dd06319c3b52b85c96fe871d51d
2011-07-25 14:39:00 -07:00
James Dong
aba28e7fec Merge "Deprecate two methods in MediaRecorder.java class" 2011-07-22 17:59:10 -07:00
Pannag Sanketi
897e27bc75 Connect MediaRecorder Native to SurfaceMediaSource
Making a connection from MediaRecorder Native layer to the
SurfaceMediaSource for the purpose of encoding GL Frames. This will be
called from the java side inside the Mobile Filter Framework.

The mediarecorder native layer (client), when set the videosource to
option VIDEO_SOURCE_FRAMES, asks the StageFrightRecorder on the mediaserver
side to create a SurfaceMediaSource object and pass it back as a
sp<ISurfaceTexture> object. Using that, the client side will dequeue and
queue buffers. Connecting the GL Frames to the obtained
sp<ISurfaceTexture> is not part of this CL.

Related to bug id: 4529323

Change-Id: I651bec718dd5b935779e7d7a050b841c2d0b0fcd
2011-07-22 14:17:25 -07:00
James Dong
3ff98beeaf Deprecate two methods in MediaRecorder.java class
Change-Id: I98fbe628fe77867b97c04f44458948ede2f49d22
2011-07-22 11:45:50 -07:00
Chih-Chung Chang
25ba294d1f Add filename and line number in the debug messages.
Change-Id: I0e19215cd6f26ccd97bcbff765194adda5faf940
2011-07-22 05:08:39 +08:00
Hong Teng
432fb8ecbe Merge "fix for issue 4142219 Don't hard code platform-specific limitations-jni/java part" 2011-07-21 11:13:43 -07:00
Jeff Brown
2c70d4a372 Untangle MediaScanner error handling.
Bug: 5056917

Change-Id: I1a7a73579e3ba4e9709459329fc1901a28b0f4b1
2011-07-20 17:33:13 -07:00
Hong Teng
600acf14ff fix for issue 4142219
Don't hard code platform-specific limitations-jni/java part

Change-Id: Icde261b1caf29a8cf552884c97f3c9d0b41741a3
2011-07-20 16:51:39 -07:00
Mike Lockwood
c1b9bbb21c Remove some #ifdef HAVE_ANDROID_OS that were needed for the simulator build
Change-Id: I13d9f251f86c05ae5405f37adbf6b8e9660935ba
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-13 19:45:44 -04:00
Mike Lockwood
dcc31946f2 MTP: Clean up MtpServer initialization and threading:
Move thread from native to Java code
Remove the stop() method (the thread will exit on its own)

Change-Id: Ib897c3630162f82669a4ee8c187e8172da50b29d
2011-07-13 09:44:42 -04:00
Mike Lockwood
a59a1bad85 Merge "Remove unnecessary locking from MediaScanner JNI code" 2011-07-11 12:15:21 -07:00
Mike Lockwood
af16d0b30e Remove unnecessary locking from MediaScanner JNI code
There is nothing in this file that requires a global lock.
Furthermore, the lock can cause timeouts in native_finalize if one instance
is being garbage collected while another is busy in processDirectory

Bug: 5002520

Change-Id: I8717f8edeb932200d9f76b3d98915cfbe18b6ec6
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-11 15:07:10 -04:00
Mike Lockwood
7a59dd2ce3 MTP: Return error if user tries to copy a file >= 4GB to a FAT32 file system
Bug: 4561836

Change-Id: I2bffb93b032038f6c220c24c752ccd7ca66c23a0
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-11 13:40:02 -04:00
Eric Laurent
5cc0526339 Moved and renamed effect API header files
Moved specific effect header files to
system/media/audio_effects/include/audio_effects
and renamed to lower case (effect_xxx.h).

Change-Id: Icfc2264bfd013cab0395d7e310ada636b9fe3621
2011-07-07 15:25:51 -07:00
Chih-Chung Chang
ff90212a3c Remove curtain effect (it's unused).
Change-Id: I2addf390aaa5aa514238b1f98eea67f27745cbf1
2011-06-30 14:41:20 +08:00
Wu-cheng Li
42419ce28a Add framework support for camcorder zoom.
The purpose of ICameraRecordingProxy and ICameraRecordingProxyListener is to
allow applications using the camera during recording.

Camera service allows only one client at a time. Since camcorder application
needs to own the camera to do things like zoom, the media recorder cannot
access the camera directly during recording. So ICameraRecordingProxy is a proxy
of ICamera, which allows the media recorder to start/stop the recording and
release recording frames. ICameraRecordingProxyListener is an interface that
allows the recorder to receive video frames during recording.

ICameraRecordingProxy
  startRecording()
  stopRecording()
  releaseRecordingFrame()

ICameraRecordingProxyListener
  dataCallbackTimestamp()

The camcorder app opens the camera and starts the preview. The app passes
ICamera and ICameraRecordingProxy to the media recorder by
MediaRecorder::setCamera(). The recorder uses ICamera to setup the camera in
MediaRecorder::start(). After setup, the recorder disconnects from camera
service. The recorder calls ICameraRecordingProxy::startRecording() and
passes a ICameraRecordingProxyListener to the app. The app connects back to
camera service and starts the recording. The app owns the camera and can do
things like zoom. The media recorder receives the video frames from the
listener and releases them by ICameraRecordingProxy::releaseRecordingFrame.
The recorder calls ICameraRecordingProxy::stopRecording() to stop the
recording.

The call sequences are as follows:
1. The app: Camera.unlock().
2. The app: MediaRecorder.setCamera().
3. Start recording
   (1) The app: MediaRecorder.start().
   (2) The recorder: ICamera.unlock() and ICamera.disconnect().
   (3) The recorder: ICameraRecordingProxy.startRecording().
   (4) The app: ICamera.reconnect().
   (5) The app: ICamera.startRecording().
4. During recording
   (1) The recorder: receive frames from ICameraRecordingProxyListener.dataCallbackTimestamp()
   (2) The recorder: release frames by ICameraRecordingProxy.releaseRecordingFrame().
5. Stop recording
   (1) The app: MediaRecorder.stop()
   (2) The recorder: ICameraRecordingProxy.stopRecording().
   (3) The app: ICamera.stopRecording().

bug:2644213

Change-Id: I15269397defc25cbbcae16abc071c8349c123122
2011-06-27 15:44:57 +08:00
Shailendra
d7ed599263 Fix for kenBurn Effect for PNG image is crashing (4861071 )
Change-Id: I4b9905ca862a1f0eac0bed4c7f021e93f79ea592
2011-06-22 12:15:56 -07:00
Mike Lockwood
7d40d42a36 MTP: Add support for PTP variant of GetDeviceInfo result.
Change-Id: I09f86fda768b7697665e401adb9516588859bf59
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-21 08:27:06 -04:00
Glenn Kasten
79cd8ba46b Remove unneeded #include <sys/resource.h>
Suggested in code review for previous change.

Change-Id: Ic3225b240367dc6c9bf56fb4498fb8a0f9f806ec
2011-06-15 07:30:19 -07:00
tedbo
cc5278a3e2 Support for setting a ParcelSurfaceTexture as the MediaPlayer sink.
This adds support for setting a SurfaceTexture as the MediaPlayer video
sink by using a ParcelSurfaceTexture object. The goal is to enable a
SurfaceTexture to pass through Binder (via ParcelSurfaceTexture) and then
be set on the MediaPlayer.

Change-Id: Ife5689ce673eb4bee1c377019db761685217b71d
2011-06-13 14:27:39 -07:00
Mike Lockwood
aa48835ce9 MTP: Remove obsolete setPtpMode support
PTP mode will be implemented as a separate USB function instead.

Change-Id: I9304c1936c70604ab2ed9704c6b95e11b61f5ba2
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-08 09:19:23 -07:00
Glenn Kasten
e46a86fcb6 Revert "Use AudioTrack::event_type not int in callback"
This reverts commit 2225e4b7049fa3fb9d39a068b8268b63c952d7c1
2011-06-01 15:20:35 -07:00
Glenn Kasten
2225e4b704 Use AudioTrack::event_type not int in callback
Change-Id: Ifefc708d46874e04fd0d01cb6e2d43b987ee796c
2011-06-01 13:50:23 -07:00