300 Commits

Author SHA1 Message Date
James Dong
83dd43f45a Do not support still image capture mode for timelapse video recording
related-to-bug: 4973779

Change-Id: Ica665217ab10247b2242acc4e93d4fe9f83e3f45
2011-07-24 10:33:54 -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
Andreas Huber
bd8fbfa956 Fix seek behaviour at startup and teardown of media session that hasn't been started
Nuplayer specific.

Change-Id: I7b0be52c29bdb7032414d63c503d686df7844bf6
2011-07-15 16:26:47 -07:00
Andreas Huber
67d464f47e Enable signalling of a stream discontinuity involving a format-change
through IStreamListener.

Change-Id: Ic0409cdc4891ad26b61f2f98bdda3c7fb2e2de6a
related-to-bug: 5022434
2011-07-13 09:47:09 -07:00
Jeff Brown
bd882b1c87 Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I04d722f258951a3078fe07899f5bbe8aac02a8e8
2011-07-11 22:12:16 -07:00
James Dong
be650872f8 Use advertised h264 encoding parameters by default if the profile is not baseline
o Force to use AVC baseline profile for camcorder low quality videos

Change-Id: I3424c57dd0c55fc4991f5767b57695c8f3420ecb
2011-07-08 10:44:05 -07:00
Andreas Huber
603d739b5a Charge network traffic to the uid of the process using the MediaPlayer.
Change-Id: I2bcb54b8232afd3fc7ee16289f37c7a7b3f23067
related-to-bug: 4517282
2011-07-01 13:18:43 -07: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
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
Andreas Huber
fddf5d9f48 Make dumpsys(media.player) more useful by having AwesomePlayer populate it.
Change-Id: I12ba7d542331a8293d67a0d47378b8be4f777759
2011-06-08 16:04:26 -07:00
Glenn Kasten
6af763bec7 Remove dead code related to gettid
The gettid system call is always available now.

Change-Id: Ib78b41781eda182dc8605daf456bbea7ff7c2dc0
2011-06-03 16:12:37 -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
Jean-Michel Trivi
5439223b56 Use channel mask instead of channel count for track creation
Record and playback objects (resp AudioRecord and AudioTrack)
are created using a channel mask, but this information is lost
in the mixer because only the channel count is known to
AudioFlinger. A channel count can always be derived from a
channel mask.

The change consists in:
- disambiguiting variable names for channel masks and counts
- passing the mask information from the client to AudioFlinger
 and the mixer.
- when using the DIRECT ouput, only verifying the format of
 the track is compatible with the output's for PCM.

Change-Id: I50d87bfb7d7afcabdf5f12d4ab75ef3a54132c0e
2011-06-01 10:55:29 -07:00
Andreas Huber
eb2f9c193d Support mpeg1,2 audio and mpeg1,2,4 video content extraction from .ts streams.
Change-Id: I9d2ee63495f161e30daba7c3aab16cb9d8ced6a5
2011-05-25 15:57:07 -07:00
James Dong
13a33169b7 Support platform and camera dependent recording start time offset
related-to-bug: 4390777

Change-Id: Icb52973ad4ac716f04fb103ef527915a966d06d5
2011-05-14 07:18:43 -07:00
James Dong
987ab4833e Support for storing geo information in the recorded mp4/3gpp file.
o Geo data (latitude and longitude) is stored in udta box

Change-Id: I76e4aeb741c4b339f3753d3d28190151f3ea4919
related-to-bug: 4260295
2011-05-13 16:29:19 -07:00
Dima Zavin
34bb419e59 update for new audio.h header location
Change-Id: Ic4c62c4037800802427eb7d3c7f5eb8b25d18876
Signed-off-by: Dima Zavin <dima@android.com>
2011-05-12 14:09:57 -07:00
Andreas Huber
93c612e2e7 The decoder wrapper is no longer needed. Also disable building old-style decoders.
Change-Id: Ie022f1a6dffe619c1b0385aa13f63e097282cfe4
2011-05-12 11:24:13 -07:00
James Dong
f84bfabe0d Initial check-in for AACWriter
Change-Id: Ia21ca39a404484b2dda25c6101780d2ff11c4623

related-to-bug: 4211046
2011-05-04 13:38:31 -07:00
Gloria Wang
d01ec6eab0 Add setParameter/getParameter to MediaPlayer API.
for bug 1982947

Change-Id: If3f40e4f18cbba155af29944af38bdc627f8cd53
2011-04-29 10:24:03 -07:00
Dima Zavin
24fc2fb1c5 audio/media: convert to using the audio HAL and new audio defs
Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5
Signed-off-by: Dima Zavin <dima@android.com>
2011-04-27 13:10:10 -07:00
Andreas Huber
5087494011 Add extra headers specified in the media player's setDataSource call
to all http requests made by the http live implementation.

Change-Id: I9dd78bb261bc678ea98c82009ca2634b74f3cd58
related-to-bug: 4315346
2011-04-20 09:22:06 -07:00
Gloria Wang
162ee49e1c - Add another parameter in notify() to be able to send timed text sample
through listener during video playback.
- Add OnTimedTextListener in the MediaPlayer
For feature request 800939.

Change-Id: I65072c27acb4c0037109a72be38c73e9f667420f
2011-04-13 11:11:34 -07:00
Andreas Huber
dc5ba0451c Merge "This reverts an earlier change 4aeec2da39fce4de9b07b694d59fd308ffb3d491" 2011-04-04 12:45:23 -07:00
Andreas Huber
c6e3b27fa1 This reverts an earlier change 4aeec2da39fce4de9b07b694d59fd308ffb3d491
Instead of returning 0-filled buffers after EOS from AudioTrack we do this
work in AudioOutput instead. That way the EOS signal (0 frames returned)
is preserved in AudioCache which otherwise would lead to a heap size overflow
filling everything with zeroes.

Change-Id: I7e07429ba887957a4340dd4b21eef4bba76248cd
related-to-bug: 3514073
2011-04-04 11:43:40 -07:00
Andreas Huber
8e64c31f6c Avoid a race condition while signaling audio EOS/seek complete by acquiring the lock.
Change-Id: Idfea452ff661b264e013fe515bcd2a2762bd959c
related-to-bug: 4193552
2011-04-04 11:29:35 -07:00
Mathias Agopian
696257ccf3 merge libsurfaceflinger_client into libgui
this is the first step in unifying surfacetexture and surface.
for this reason the header files were not moved, as most of them
will eventually go away.

NOTE: currently we keep libsurfaceflinger_client.so as an empty
library to workaround prebuilt binaries wrongly linking against
it.

Change-Id: I130f0de2428e8579033dc41394d093f4e1431a00
2011-03-25 18:42:40 -07:00
Andreas Huber
554d0ea10f Enable http-live support for https:// urls, fix a parsing issue.
Change-Id: I2284e1d62babde7f739fba6a3cb4e2619f0e62f9
related-to-bug: 4148291
2011-03-21 16:34:02 -07:00
Eric Laurent
7a4b8bd588 Merge "Fix issue 3483718: audio streaming and A2DP." 2011-03-21 14:06:33 -07:00
Eric Laurent
6667ac33f4 Fix issue 3483718: audio streaming and A2DP.
The problem is that when switching from A2DP to device speakers or headset,
The AudioTrack binder interface to AudioFlinger must be destroyed and restored
to accomodate new buffer size requirements. Current AudioTrack implementation
did not restore properly the PCM buffer write index which caused a mismatch between
the written frame count in the mediaplayer renderer and the AudioTrack. The renderer
could then believe the AudioTrack buffer was full and stop writing data preventing the
AudioTrack to reach a bufffer full condition and resume playback.

The rendered was also modified to refresh the AudioTrack frame count (buffer size)
inside the write loop in NuPlayer::Renderer::onDrainAudioQueue() as this count can change
from one write to the next.

Also modified AudioTrack::obtainBuffer() to check for track invalidated status before
querying for available space in the buffer. This avoids writing to the old track's
buffer until full before detecting the invalidated condition and create a new track.

Change-Id: I16a857e464e466880847f52f640820aa271539ad
2011-03-21 11:49:00 -07:00
Andreas Huber
5b7ced6a4e Support passing headers to MediaMetadataRetriever's setDataSource API
Change-Id: Ib1a5c08fc5034cac05034db27007a35c9b660b26
related-to-bug: 3506316
2011-03-21 11:13:59 -07:00
James Dong
be3c82f25d am 782ffe91: am 9c0c5b56: am 2f1f2248: Fix missing AOSP copyright headers for a bunch of media framework files
* commit '782ffe91da665c6b1fb9e297faa6e0dc6035f40c':
  Fix missing AOSP copyright headers for a bunch of media framework files
2011-03-17 12:38:58 -07:00
James Dong
2f1f2248c8 Fix missing AOSP copyright headers for a bunch of media framework files
bug - 4119349

Change-Id: If5924e16a5f596d5d73d9beb66eaf5ac9a6f0e50
2011-03-17 11:10:40 -07:00
James Dong
ed73246b32 Add memory leak tracking/debugging code to drm server
bug - 4099038

Change-Id: I6c048eaf3d7f34bc144b8daaa5fdef1ed474af66
2011-03-14 18:48:19 -07:00
Gloria Wang
396f6de660 Merge "- To track the usage of all audio output devices - To track the currently used audio device - The devices are separated as speaker and other audio devices - Provide the collected data to battery application through pullBatteryData()" 2011-03-02 19:51:04 -08:00
Gloria Wang
9b3f1521b5 - To track the usage of all audio output devices
- To track the currently used audio device
- The devices are separated as speaker and other audio devices
- Provide the collected data to battery application through pullBatteryData()

Change-Id: I374c755266b5ac6b1c6c630400f4daf901ea8acc
2011-03-02 16:53:24 -08:00
Andreas Huber
669ad13de9 Allow optional specification of a PTS timestamp when signalling a discontinuity.
If present, rendering will be suppressed until reaching the timestamp.

Change-Id: Ic64bdf4225063c5a4d042ea9809960b843a46d19
related-to-bug: 3489454
2011-03-02 15:38:32 -08:00
Andreas Huber
a28f6f11f2 Merge "Suppress the logging of URLs when in incognito mode." 2011-02-24 14:49:10 -08:00
Andreas Huber
53182c439c Suppress the logging of URLs when in incognito mode.
Change-Id: Ib951b495eae15669e160ef54686eab0eeb9b366a
related-to-bug: 3336575
2011-02-24 14:42:48 -08:00
Glenn Kasten
373ed6fc79 Merge "Bug 3438258 Add SurfaceTexture as MediaPlayer sink" 2011-02-24 12:37:02 -08:00
Glenn Kasten
cc562a3576 Bug 3438258 Add SurfaceTexture as MediaPlayer sink
This change enables the use of a SurfaceTexture in place of a Surface
as the video sink for an android.media.MediaPlayer. The new API
MediaPlayer.setTexture is currently hidden.

This includes:
 - New Java and C++ interfaces
 - C++ plumbing and implementation (JNI, Binder)
 - Stagefright AwesomePlayer and NuPlayer use ANativeWindow
   (either Surface or SurfaceTextureClient)

Change-Id: I2b568bee143d9eaf3dfc6cc4533c1bebbd5afc51
2011-02-23 15:02:56 -08:00
Gloria Wang
62e05a6159 To collect the total usage time of encoders in the media recorder
Change-Id: I94c9c94dec6bd714a3ebf96b4465b94f069e55b8
2011-02-23 13:20:21 -08:00
Gloria Wang
d211f41f76 - Add method in MediaPlayerService to collect and pull
codec usage (duration) for the battery app
- Collect MediaPlayer decoding usage data

Change-Id: I0ef4e32b6a041ba1fe73c19f9c67185c61d03965
2011-02-22 22:42:05 -08:00
Andreas Huber
d6c421f1a0 Remove legacy, AwesomePlayer-based http live implementation.
Change-Id: I455d0faa5612dcd4d2bb6f2b3c7b64a1caaabf69
2011-02-16 09:19:40 -08:00
James Dong
75fb238b3f Should reset errno to 0 before calling strtoll().
bug - 3431238

Change-Id: I855847209d2e022242b8eb62985759922ab94779
2011-02-08 15:41:58 -08:00
James Dong
5f3ab06e90 Make sure that key frame is generated for timelapse video recording if there are at least two input video frames from camera source.
This will fix the stop failure issue where we have to wait n * time_interval before a key frame can be received by the file writer, where
 o n is the actual number of buffers advertised by the video encoder
 o time_interval is the interval settings for timelapse video recording
   specifying the time distance between neighboring input video frames

The fix includes two parts:
o OMXCodec will not submit all n buffers at one time, but instead submit one input
  frame at one time if it become available.

o Timelapse camera source made available the first two input frames and do not skip
  them so that the first compressed output frame data can be received regardless
  the specified time_interval

bug - 3367659

Change-Id: Ia68cc2cb0d71aa7dc54540e9ad82fae911ad530b
2011-01-26 12:11:22 -08:00
Andreas Huber
19922adceb Some tweaks to HTTP live / nuplayer behaviour
- play audio-only streams again
- workaround for malformed streams that switch PIDs across bandwidths
- attempt to pick a different bandwidth stream if the previously chosen one appears
  to be malformed/unsupported.

Change-Id: I426d0a40dc725aa242f619d4c9d048b69aca55c9
related-to-bug: 2368598
2011-01-21 10:34:40 -08:00
Andreas Huber
601fe0e595 Implement missing pause/resume support for NuPlayer.
Change-Id: Ia3f1ce521dd4b70e134ef03aa7c9db8e8d39a134
related-to-bug: 2368598
2011-01-20 15:23:04 -08:00
James Dong
44b004b0c2 Eliminate recording sound by starting the video track before audio track.
Due to the variable delays in the system, the recording sound can still be heard
if the audio track is started early. This happens even after we suppress a relative
long period of initial audio for a recording session. By starting the video track
before the audio track, we effectively play the recording sound earlier.

bug - 3371141

Change-Id: I2cccf77eae953d96827fc080c618b1d962445c26
2011-01-20 06:58:16 -08:00