History log of /frameworks/av/media/libstagefright/MediaCodecSource.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c68689dfd6fa3b880a0d8e75408b582b389630f8 24-Aug-2016 Praveen Chavan <pchavan@codeaurora.org> libstagefright: Add error handling in mediacodecsource

During camcorder recording, if encoder throws an error,
it intimates error to media codec source.
In such error cases, added functionality to stop puller
and clean up the graph to avoid memory leaks.

Bug: 34870133
Test: Video Recording.

Author: Uma Mehta <umamehta@codeaurora.org>

Change-Id: I487d96f855f541033e8ec7872e86d00bafb96daf
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
764d945bfdb9dec60f2b482fbf6c5e83824ed950 13-Dec-2016 Hangyu Kuang <hkuang@google.com> media: Support accurate pause/resume/stop in GraphicBufferSource.

Process all buffers that have been queued to the encoder on
StagefrightRecorder::pause()/stop(). Furthermore, add timestamp support for
pause/stop. Buffers willi keep getting encoded until 1) a buffer with a higher
timestamp is queued, or 2) the bufferqueue is abandoned by the producer.

Test: Recording with hacking GoogleCamera timestamp. And Mediarecorder CTS test.
Bug:32765698
Change-Id: I9ec33d635aef269836d7a5d9f4b906cb41b46a0d
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
e36e1034c2938559c96d1e765b3c75380c83ff6b 07-Jan-2017 Haynes Mathew George <hgeorge@codeaurora.org> libstagefright: Add NULL check during memcpy for MediaCodecSource

Add null check for the source buffer prior to memcpy.
Test: compiles
Change-Id: I5971e0c01fd4821078780c9623154e396f679357
CRs-Fixed: 1096369

authored-by: Garmond Leung<garmondl@codeaurora.org>
(cherry picked from commit 85bb3ddece3140a59e1ecb25187e0d69fe85f002)
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
addf2cbb120346ae42e78fa739245a353db5edad 29-Sep-2016 Chong Zhang <chz@google.com> IOMX: consolidate createInputSurface APIs

- Create GraphicBufferSource in IOMX regardless of persistency.

- Remove createInputSurface on IOMXNode, only keep setInputSurface
which accepts either a persistent or non-persistent surface.

- Instead of holding a IGraphicBufferConsumer, hold
IGraphicBufferSource across session as the persistent surface.

- Fix up GraphicBufferSource to allow usage across sessions.
GraphicBufferSource itself becomes agnostic to persistency.

- Remove max encoder input buffers profiling code.

bug: 31399200
Change-Id: I15ed52cc64509fd87736372a580abf7b51bf4de7
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
2715aa16d6c43737cb490738bba7b451d89c82f6 07-Oct-2016 Andy Hung <hunga@google.com> MediaCodecSource: Fix buffer allocation am: 01d1e52558 am: 578f4e60cd
am: 811bc42440

Change-Id: I28ff5f5f8f75d47974c4fbe7849c4e1750e7fd9e
811bc424407084dbad79eecec07f2b51bc9fa55a 07-Oct-2016 Andy Hung <hunga@google.com> MediaCodecSource: Fix buffer allocation am: 01d1e52558
am: 578f4e60cd

Change-Id: Ic0c71b9bc0a4762c30f7985de4727b690af9296f
01d1e525584d037b80d7c9ab79010fd2a5b9a870 06-Oct-2016 Andy Hung <hunga@google.com> MediaCodecSource: Fix buffer allocation

Bug: 31976029
Change-Id: I2ded0f8f1d51e63639e0f86376557e3d0d4f1cd3
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
a86b65e69f6a76cabab37ef480aaa86dca38b3ea 04-Oct-2016 Hangyu Kuang <hkuang@google.com> Merge "media: Fix mpeg2ts muxer."
7e34bf5af26f8752d4786d3098740cdf51e2438f 22-Aug-2016 Wonsik Kim <wonsik@google.com> MediaCodec refactoring part 1-a: buffers become separate class

MediaCodecBuffer is meant to replace ABuffer and MediaBuffer in
communication between framework components. As the first step, replace
use of ABuffer in MediaCodec with MediaCodecBuffer, and adjust related
classes accordingly.

MediaCodec.getBuffer() and related APIs now returns MediaCodecBuffers;
thus change MediaCodec clients to use MediaCodecBuffer accordingly.

Test: manually tested for key use cases (Camera, YouTube and Play Movies)
Change-Id: Iba7ce131645e75ce5ddbf497fb793ab38b7f245b
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
8f889be4754d40f39c9377b055988f58f3ed64a8 21-Sep-2016 Hangyu Kuang <hkuang@google.com> media: Fix mpeg2ts muxer.

1) Fix the CSD handling due to missing timestamp in CSD buffer.
2) Remove the concatenation of audio frames and write out every audio frame
immediately to unblock the video frame write out.
3) Unblock audio track thread after geting CSD.

Bug:21620607
Change-Id: I4926ef7202e1692a2c50a5e8158a9cfb19d9ed3f
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
6d332d2cdf6e62c2c20ebff220868fe9e3ed7f44 07-Sep-2016 Chong Zhang <chz@google.com> stagefright: abstract GraphicBufferSource to interfaces

Create two interfaces from GraphicBufferSource:

a) IGraphicBufferSource for client (ACodec) to configure the graphic
buffer source. IOMX no longer routes these messages and OMX internal
options are removed.

b) IOMXBufferSource for IOMX to send OMX specific callbacks.

Added an |origTimestamp| argument to emptyGraphicBuffer, and restore
the original PTS inside OMX to avoid going back to GraphicBufferSource
to patch the output PTS. In the longer term, we should consider moving
the max PTS gap entirely into OMX (probably as an extension index).

Define newly introduced interfaces using AIDL to facilitate code
development.

bug: 31399200

Change-Id: Ibaf6ca1a0737ba6ba9f83bedc3b06ef358db36cb
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
3dfe842f35e2ee752f5b5b860d63b00863ad6179 02-Sep-2016 Hangyu Kuang <hkuang@google.com> media: Move video buffer timestamp adjustment from CodecSource to GraphicBufferSource. am: 61fcfd1b0b
am: 5ed707356a

Change-Id: I9e779e5de2d108a5b0c66c80d0613a3bdaf7fa6e
61fcfd1b0b58dff9284ede8dc49749ca7395856d 30-Aug-2016 Hangyu Kuang <hkuang@google.com> media: Move video buffer timestamp adjustment from CodecSource to GraphicBufferSource.

Bug:30919939
Change-Id: I7c1b626eee8512dac691b03309f724b3351e6e2f
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
f5a40c689555e845dd79184810355e5307f23e01 19-Aug-2016 Wonsik Kim <wonsik@google.com> mediarecorder: fix timestamp adjustment for early pause/resume am: a5aeb87eab
am: 5fe669bafa

Change-Id: I974f0099a03d7a783aeebbb514b7936f11caa463
daa5dafca558aab3b46204fcee630e3a40ba4823 19-Aug-2016 Wonsik Kim <wonsik@google.com> Revert "media: Mediarecorder drops the mediabuffer with negative adjusted timestamp." am: e35600eb62
am: 1a9c34d61f

Change-Id: I84fb98539b1e98c7e229eaf09f6184e37bb2eca8
a5aeb87eabfda3cb385eed405b843bdcb64252be 29-Jul-2016 Wonsik Kim <wonsik@google.com> mediarecorder: fix timestamp adjustment for early pause/resume

Bug: 30549032
Change-Id: Iafb916454499e9fac3af3b8a6abe06c652f84564
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
e35600eb62d4a2dc2dd0cc8c0d0d177cec7ed1cc 28-Jul-2016 Wonsik Kim <wonsik@google.com> Revert "media: Mediarecorder drops the mediabuffer with negative adjusted timestamp."

This reverts commit 901ca36bf02726ca07d83820c93c76d696549a03.

Change-Id: I56a0ec7b8d70e19cc6009d8fbc4560becf1d04c9
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
9c9e44a9654287866a9a972688b5363f18198bc9 15-Jun-2016 Hangyu Kuang <hkuang@google.com> media: Mediarecorder drops the mediabuffer with negative adjusted timestamp.
am: 901ca36bf0

Change-Id: I349546e2a2d3c6eb6bc6f0f1b2b1c521e25c7650
901ca36bf02726ca07d83820c93c76d696549a03 14-Jun-2016 Hangyu Kuang <hkuang@google.com> media: Mediarecorder drops the mediabuffer with negative adjusted timestamp.

In some rare cases, mediabuffer's adjusted timestamp may become negative due to
the extra delay adjustment at the beginning of start/resume. Drop the buffer in
these cases.

Bug: 29165056
Change-Id: Id8f68c188e76c9c077d41ff9901452f5aeb02d2a
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
f2a4c632b254a176ddccb4d78af2d2a8c7231060 10-May-2016 Lajos Molnar <lajos@google.com> Merge changes I58b03acd,I7d7eb086 into nyc-dev am: 0d0a8b48d2
am: f1a0ec37b9

* commit 'f1a0ec37b9edd755ba95835acedd6673dfd947e2':
stagefright: untangle metadata-mode handling
stagefright: add a way to update native handle in OMX buffers

Change-Id: I9d1b51e1c6f486f1c8fe36383adcc4261b056256
3e328782f1e1061d08ea0c45b855cc418a2d9ea6 09-May-2016 Lajos Molnar <lajos@google.com> stagefright: untangle metadata-mode handling

- specify requested metadata mode from producers to OMX
- (pass requested metadata in IOMX::storeMetadataInBuffers)
- use correct logic for native handle source
- use native handle source for encoded meta buffers

Bug: 22775369
Change-Id: I58b03acd3e9a5367d5010d7f87b7af5cae23362c
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
47734c9509ecb472c2844cae46e2d916b9358321 02-May-2016 Chih-Hung Hsieh <chh@google.com> resolve merge conflicts of 98a9b2a to nyc-dev-plus-aosp

Change-Id: Iae0a5cb698807d74ba28878d7ce1f69b6ba5219a
090ef604f81447eab4aa0a5b45d6307482573560 27-Apr-2016 Chih-Hung Hsieh <chh@google.com> Fix google-explicit-constructor warnings.

Bug: 28341362
Change-Id: I625fbab25f16282c2ea929cd16283d9d146fa17b
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
4cca134f0a775808458622490886d775c59bcc54 28-Mar-2016 Wonsik Kim <wonsik@google.com> stagefright: request IDR on MediaRecorder.resume

Bug: 27658238
Change-Id: I7c7150fcbe980fadf65821028bb99144774dcb69
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
ee0eba046f666303741a5a5f70afad17030cc8b1 22-Mar-2016 Lajos Molnar <lajos@google.com> stagefright: MediaCodecSource: protect output format updates

avoid race condition between format updates and reads.

Bug: 27477022
Change-Id: Ie4aee2d902296db8a8c055a7016acd1b879f437a
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
68a91b9dbe8d70c5542df4f3eb5f9a4f803ba10a 16-Mar-2016 Eino-Ville Talvala <etalvala@google.com> Merge "Camera: Update dataspace to new spec, convert for older HALs" into nyc-dev
58fb7c6e1a9244dd7215a647388c440d8d75851b 15-Mar-2016 Lajos Molnar <lajos@google.com> stagefright: use colr box for color aspects

Bug: 25684127
Change-Id: I105294ce0d41ac58d80a2a4a74d35a9b78536790
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
2cbf6cea23539bfe99e36d1d221de62255452e86 14-Mar-2016 Eino-Ville Talvala <etalvala@google.com> Camera: Update dataspace to new spec, convert for older HALs

- Switch clients of camera devices to use new dataspace values
- For older HALs, map to legacy dataspace values

Bug: 27344373
Change-Id: Icabc345025383f987ef4472cd26182a580dc8b3c
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
b77d03b62cb743d0faf74b54aa466b4d220b5e61 03-Mar-2016 Lajos Molnar <lajos@google.com> stagefright: connect color aspects and surface dataspace

1. Keep configuration format as video decoder and encoder will need
it to reset their default color aspects on mode/size change.

2. Separate color aspect handling for decoder and encoder as they
are quite different. Update decoder and encoder color aspect setting
to latest policy.

3. propagate dataspace to GraphicBufferSource, MediaCodecSource,
CameraSource and SoftwareRenderer

Bug: 25684127
Change-Id: Ie9a7528af36ed44605a7ce3e69b5794ef16b1c66
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
6d6c21b8d2ed66007833dae0451b0a211c97e592 07-Mar-2016 Wonsik Kim <wonsik@google.com> stagefright: fix MediaCodecSource.pause() behavior

Don't signal EOS when the source is simply paused.

Bug: 27290834
Change-Id: Id8f0697a3761ae96bfa617fceb1c54558ab82090
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
72e9ab92e0dbee8d19ae2ec92ecd0a172b231b44 23-Feb-2016 Lajos Molnar <lajos@google.com> stagefright: MediaCodecSource: wait till upstream source stops on stop

Bug: 27221797
Change-Id: I906a37f5072b1a885fc475132d641c9444290c45
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
ea1a45dbdf7fd6f435f92d20a95f432cf3f147b5 31-Aug-2015 Lajos Molnar <lajos@google.com> stagefright: rework MediaCodecSource

Redesigned MediaCodecSource to fix issues with source::stop(), where
there were still outstanding input buffers when the input source was
closed.

- moved input queue and state inside Puller
- Puller::pause, resume and stop is now atomic from caller's thread
- input source is accessed from Puller's looper, unless a blocked read
operation is detected.
- added stop timeout, so if Puller's looper is blocked, but it is not
yet detected, input source->stop is still called.

- using Mutexed helper class to ensure locked member access

Bug: 26964806
Change-Id: Icd6d4fc42a7c8e08b54e856c028f3d1fed5ae32d
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
2e18508d33b845ef77676559d3bb70acc37b39ee 05-Feb-2016 Lajos Molnar <lajos@google.com> stagefright: add PREFER_SOFTWARE_CODEC flag to MediaCodecSource

Bug: 17108024
Change-Id: I553d7ccf9df9d4eb3d8bffa2f11ae32d03b9d6c3
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
6a3a56fbcd6c01c3895f14e43858971b0edca9b2 03-Feb-2016 Lajos Molnar <lajos@google.com> stagefright: rework MediaCodecSource

Redesigned MediaCodecSource to fix issues with source::stop(), where
there were still outstanding input buffers when the input source was
closed.

- moved input queue and state inside Puller
- Puller::pause, resume and stop is now atomic from caller's thread
- input source is accessed from Puller's looper, unless a blocked read
operation is detected.
- added stop timeout, so if Puller's looper is blocked, but it is not
yet detected, input source->stop is still called.

- using Mutexed helper class to ensure locked member access

Bug: 26964806
Change-Id: Icd6d4fc42a7c8e08b54e856c028f3d1fed5ae32d
(cherry picked from commit 6d26518f0c3872bc54ececb0fbbba0c006d72553)
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
16fcc47c113e63efa69f5af5decf1ad46ec653a9 05-Feb-2016 Lajos Molnar <lajos@google.com> stagefright: add PREFER_SOFTWARE_CODEC flag to MediaCodecSource

Bug: 17108024
Change-Id: I553d7ccf9df9d4eb3d8bffa2f11ae32d03b9d6c3
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
d008275796ac4cccf85fefce53cef733a49bc1fa 31-Aug-2015 Wonsik Kim <wonsik@google.com> Implement pause/resume functionality to MediaRecorder

Bug: 20092236
Change-Id: Ia0e92ff246302fd5fdef53c4f961d6645cc26a86
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
c93a13669ce1b5a9e6527b4c86c9d8f5e92be828 26-Jun-2015 Lajos Molnar <lajos@google.com> stagefright: ask for flex-YUV camera buffers for software encoders

Bug: 13222807
Change-Id: I854b73a63cf9239311729598241725d84e8513aa
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
8f469e18c307cb9dc0d16ed9225972aa8be4516f 13-May-2015 Chong Zhang <chz@google.com> stagefright: rename usePersistentInputSurface to setInputSurface

and clear persistent surface pointer when MediaRecorder is reset

bug: 21045118
bug: 21045402
Change-Id: Ifd0d6deeb969f2252123929541b30b518cecbf9a
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
e2a2dfcbf0c9d6bb7139263ecf0d8e53b4ca1049 01-May-2015 Chong Zhang <chz@google.com> MediaRecorder: implement persistent input surface APIs

Bug: 19127604
Bug: 19489395

Change-Id: I7dd8015a8fe029f9867fcdb52322629c77eff50b
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
3b0da19c78f6a61ed343a07f2448b94faafe4c02 18-Apr-2015 Lajos Molnar <lajos@google.com> stagefright: make more warnings errors

Change-Id: I9b1ad60fbfb866dbf9c00843e06553c3eb25c113
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
421f47ca9c2dcc78584b2bb609c3755483b55155 25-Mar-2015 Marco Nelissen <marcone@google.com> mediaplayer: use async mode in NuPlayer

Bug: 14679336
Change-Id: I5e471a6e13be82a375afc2718599f27cd0255bf5
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
3f27436a9346f043f52265da1e6a74cde2bffd4d 05-Mar-2015 Lajos Molnar <lajos@google.com> stagefright: don't use ALooperRoster mutex for reply handling

Change replyID-s from uint32_t to an object
Move reply handling into the loopers (to reuse a common mutex)

Bug: 19607784
Change-Id: Iaa035b846c424c5687ed17ce1079b325e86c54be
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
1d15ab58bf8239069ef343de6cb21aabf3ef7d78 05-Mar-2015 Lajos Molnar <lajos@google.com> media: switch to new AMessage handling

Bug: 19607784
Change-Id: I94cddcb81f671422ad4982a23dc4acfe57a9f1aa
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
1099188151eb63af24ecf542b58d4257bbb8236a 16-Oct-2014 Praveen Chavan <pchavan@codeaurora.org> Stagefright: use MediaCodec in async mode for recording

Async mode reduces the number of messages posted between
MediaCodec and MediaCodecSource. This reduces thread
wakeups and helps reduce CPU utilization.

Bug: 18246026
Change-Id: I4b0837f309fdd12e323c1dfa72525f5a31971a03
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
f2a64852a4a48c5a3d8a08ffcda20d6884586672 04-Oct-2014 Chong Zhang <chz@google.com> MediaRecorder: only dequeue available buffers from MediaCodec

Bug: 17514968
Change-Id: If232f92d163deb2440b927315c69e0c4d51ca290
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
96e92b58b7e9647b4c7c2f54b62a1b357ab06b66 19-Sep-2014 Wei Jia <wjia@google.com> MediaBuffer: ABuffer will release MediaBuffer when it's destructed.

Bug: 17454455
Change-Id: Ia423bcc2e1fa39137f114eac44912ed15357bb99
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
16e79115e497386eaf010af388627f94314a55a3 01-Aug-2014 Chong Zhang <chz@google.com> MediaCodecSource: stop puller from caller's thread instead of looper

Currently CameraSource/AudioSource's stop() and read() are both called
from the puller's looper. This works if source operates normally (i.e.
read() returns regularly before source is stopped), as the stop() will
eventually be handled by the looper. However, if for some reason the
source hang, it will get stuck in read(), and the stop() will never
be processed, which could lead to ANR (in addition to the source hang).

We need to move the source's stop out of the puller's looper. It also
can't be on MediaCodecSource's looper, because the source's stop
synchrounously waits for all outstanding buffers to return, these
are only returned when MediaCodecSource's looper processes the buffer.

This change moves the stop to MediaCodecSource::stop, after encoder
is shutdown.

Bug: 16522726
Change-Id: Ie91f563c5d8a98ab091bf1945af4e51f662b9403
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
a5750e0dad9e90f2195ce36f2c4457fa04b2b83e 19-Jun-2014 Mark Salyzyn <salyzyn@google.com> libstagefright: 64-bit compile warnings

Change-Id: I3d1146714fa23be3d4e696599b6f70cac1f9d28b
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
84333e0475bc911adc16417f4ca327c975cf6c36 08-Feb-2014 Andreas Huber <andih@google.com> warnings be gone.

Change-Id: Ie3bae3f037730e316d7fca12e7a3527973f752ef
/frameworks/av/media/libstagefright/MediaCodecSource.cpp
72cecca17d735db6532c45f0a7e10c47ee6f065a 26-Dec-2013 Chong Zhang <chz@google.com> Change StagefrightRecorder to use MediaCodec

Bug: 12305192
Change-Id: I72d7cb571be5bd348b58ad650f3269d24c15d350
/frameworks/av/media/libstagefright/MediaCodecSource.cpp