Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
4123360
NuPlayer: Uninitialized bool variable in fetchInputData
Nov 15, 2016
8e59f1a
libmedia : Fix for AudioRecord CTS test case
Nov 25, 2016
2d4dc76
Merge "NuPlayer: Uninitialized bool variable in fetchInputData" into …
Nov 28, 2016
5e24b9c
frameworks/av: Set Protected flag only for secure
Nov 30, 2016
b6edd95
frameworks/av: Changes to enable DRM flag
Nov 15, 2016
557bd7b
Visualizer: Check capture size and latency parameters
xt0032rus Oct 19, 2016
781bd81
stagefright: remove allottedSize equality check in IOMX::useBuffer
medialajos Oct 27, 2016
c66c43a
Fix security vulnerability: Equalizer command might allow negative in…
Oct 31, 2016
7a3246b
DO NOT MERGE: defensive parsing of mp3 album art information
rbessick4 Nov 2, 2016
26965db
Effects: Check get parameter command size
xt0032rus Nov 5, 2016
453b351
Make VBRISeeker more robust
marcone Nov 11, 2016
321ea52
Fix security vulnerability: Effect command might allow negative indexes
Nov 14, 2016
0b0a447
Promotion of av-aosp.lnx.2.0-00020.
Dec 3, 2016
8fa8fd2
OMA DRM : Give permission to access drm service api from Oma Drm engine
Nov 10, 2016
45230d2
Merge "libmedia : Fix for AudioRecord CTS test case" into av-aosp.lnx…
Dec 6, 2016
690fff0
Compilation fix: N-MR1 merge.
Dec 6, 2016
4bf2a54
Merge "Revert "stagefright: Enhance MPEG4 writer/extractor to store/r…
Dec 7, 2016
ae3ff41
Merge "Revert "stagefright: ACodec: Enable temporal layered encoding""
Dec 7, 2016
c7b7806
Merge "Revert "MPEG4Writer: Handle writing multiple NAL units in a vi…
Dec 7, 2016
84c5a52
Merge "Merge commit '9627e72fd10575df2e957edb780ddff299fc9064' into r…
Dec 7, 2016
49695a1
Merge "Compilation fix: N-MR1 merge."
Dec 7, 2016
ae89316
soundtrigger: Support multiple clients attaching to a module
Nov 29, 2016
7a6c756
Merge "OMA DRM : Give permission to access drm service api from Oma D…
Dec 8, 2016
c1d22b2
Merge "frameworks/av: Changes to enable DRM flag" into av-aosp.lnx.2.…
Dec 9, 2016
83f9ad3
Merge "frameworks/av: Set Protected flag only for secure" into av-aos…
Dec 9, 2016
bef4b15
Back_Merge_for_N_MR1
Dec 9, 2016
a155de4
Effect: Use local cached data for Effect commit
xt0032rus Nov 16, 2016
b0bcddb
Fix security vulnerability: potential OOB write in audioserver
Nov 23, 2016
3201194
Promotion of av-aosp.lnx.2.0-00021.
Dec 20, 2016
62acd24
AudioRecord: Check object state on entering read
Dec 20, 2016
d2e4e5e
HLS: force audio/video both to start from IDR position
Nov 25, 2016
d1593df
Revert "frameworks/av: Set Protected flag only for secure"
Dec 22, 2016
8b288f4
audio: allow effect chain on direct output if it's pcm offload
Dec 26, 2016
53fb6f8
audio: Don't update the audio_output flag with track flags
Nov 30, 2016
dacab78
Merge "Revert "frameworks/av: Set Protected flag only for secure"" in…
Jan 2, 2017
333354b
Merge "soundtrigger: Support multiple clients attaching to a module" …
Jan 2, 2017
9786f87
Promotion of av-aosp.lnx.2.0-00023.
Jan 2, 2017
6f4d0bd
Merge "audio: Don't update the audio_output flag with track flags" in…
Jan 3, 2017
2f19a51
Promotion of av-aosp.lnx.2.0-00024.
Jan 3, 2017
2aeccaa
audio: Reduce offload pause timeout to 3 secs
Dec 19, 2016
fdb8766
Merge "AudioRecord: Check object state on entering read" into av-aosp…
Jan 11, 2017
81d2cc7
Merge "audio: allow effect chain on direct output if it's pcm offload…
Jan 11, 2017
32ed9b1
Fix security vulnerability: Effect command might allow negative indexes
Nov 14, 2016
eab9235
Make VBRISeeker more robust
marcone Nov 11, 2016
f26d767
Effects: Check get parameter command size
xt0032rus Nov 5, 2016
e610403
DO NOT MERGE: defensive parsing of mp3 album art information
rbessick4 Nov 2, 2016
d62d387
Fix security vulnerability: Equalizer command might allow negative in…
Oct 31, 2016
3bc9a1e
stagefright: remove allottedSize equality check in IOMX::useBuffer
medialajos Oct 27, 2016
2436e97
Visualizer: Check capture size and latency parameters
xt0032rus Oct 19, 2016
71957cb
libstagefright: Add NULL check during memcpy for MediaCodecSource
Dec 7, 2016
c69eb0e
stagefright: MPEG4Writer: defer video stop to match last audio time
Oct 21, 2016
729c6cd
Promotion of av-aosp.lnx.2.0-00025.
Jan 12, 2017
d7a9430
audio flinger: Fix native crash during underruns for patch track
Jan 4, 2017
602b81a
Merge "Fix security vulnerability: Effect command might allow negativ…
Jan 17, 2017
89a1fe1
Merge changes I9b1315e2,I9bcc9422 into av-aosp.lnx.2.0-dev
Jan 17, 2017
23f1ad7
Merge "DO NOT MERGE: defensive parsing of mp3 album art information" …
Jan 18, 2017
183ea32
Merge "Fix security vulnerability: Equalizer command might allow nega…
Jan 18, 2017
5f0cf6a
Merge "stagefright: remove allottedSize equality check in IOMX::useBu…
Jan 18, 2017
e26c3c4
Merge "Visualizer: Check capture size and latency parameters" into av…
Jan 18, 2017
4996aa6
Promotion of av-aosp.lnx.2.0-00027.
Jan 18, 2017
563493e
N-MR1 NMF26V merge '321ea5257e37c8edb26e66fe4ee78cca4cd915fe' - clean
Jan 19, 2017
01cc381
Promotion of av-aosp.lnx.2.0-00028.
Jan 20, 2017
0815621
audioflinger: remove redundant adding to tracksToRemove
Nov 18, 2016
26dfb54
audioflinger: put fastmixer with active tracks into mix state when su…
Nov 28, 2016
735f274
StagefrightRecorder: avoid 30ms offset with QC AAC encoder
Jul 28, 2015
c119a6f
audioflinger: pause direct output when buffer timeout
Dec 16, 2016
2b44423
libstagefright: Check trackMeta for NULL
Jan 25, 2017
ec577f6
Merge "StagefrightRecorder: avoid 30ms offset with QC AAC encoder" in…
Jan 27, 2017
31d12fe
Merge "audio flinger: Fix native crash during underruns for patch tra…
Jan 27, 2017
da86f44
Promotion of av-aosp.lnx.2.0-00031.
Jan 28, 2017
7942bf3
Video: add support for playback of QT clips
Nov 10, 2016
87b0c07
Merge "stagefright: MPEG4Writer: defer video stop to match last audio…
Jan 31, 2017
335a7df
stagefright: Optimize stop-delay for EIS enabled recording
Nov 8, 2016
e9d4669
stagefright: MPEG4Writer: fix Integer overflow
Jan 19, 2017
0f9fcc7
Stagefright: Create CameraSource for HSR
Jan 23, 2017
ddd0b8e
AudioPolicyMng: check for null audioSession when realeasing input
Jan 31, 2017
3de5648
Merge "Stagefright: Create CameraSource for HSR" into av-aosp.lnx.2.0…
Feb 1, 2017
0f47ba4
Promotion of av-aosp.lnx.2.0-00032.
Feb 2, 2017
81346e8
vraudioservice: Instantiation
XNUBIA Feb 3, 2017
1bb5b32
NuPlayerRenderer: update mAnchorTimeMediaUs on new audio time
Feb 6, 2017
1ed0f13
Merge "AudioPolicyMng: check for null audioSession when realeasing in…
Feb 6, 2017
ced05e2
Promotion of av-aosp.lnx.2.0-00033.
Feb 7, 2017
fc65f70
Merge "Video: add support for playback of QT clips" into av-aosp.lnx.…
Feb 7, 2017
ff2c90f
Merge "libstagefright: Check trackMeta for NULL" into av-aosp.lnx.2.0…
Feb 7, 2017
be643b7
Camera: Add null check on mDevice to avoid crash
Nov 15, 2016
e06837a
Promotion of av-aosp.lnx.2.0-00035.
Feb 8, 2017
1ebf50b
Effect: Use local cached data for Effect commit
xt0032rus Nov 16, 2016
9e96973
Fix security vulnerability: potential OOB write in audioserver
Nov 23, 2016
7db3c74
Merge "vraudioservice: Instantiation" into av-aosp.lnx.2.0-dev
Feb 9, 2017
ca115ae
Promotion of av-aosp.lnx.2.0-00036.
Feb 9, 2017
09e23a3
Revert "update stune group for cameraserver to top-app"
Feb 9, 2017
b22178b
cameraserver: disable background scheduling of cameraserver
Feb 13, 2017
628b18a
StagefrightRecorder: avoid 30ms offset in pause duration for HSR reco…
Feb 15, 2017
8d867c5
Merge "Fix security vulnerability: potential OOB write in audioserver"
Feb 15, 2017
36c4736
Merge "Revert "update stune group for cameraserver to top-app""
Feb 15, 2017
abbca49
N-MR1 NMF26X merge 'b0bcddb44d992e74140a3f5eedc7177977ea8e34' - Clean
Feb 16, 2017
c50d4ef
Promotion of av-aosp.lnx.2.0-00037.
Feb 16, 2017
a943813
Merge "cameraserver: disable background scheduling of cameraserver"
Feb 17, 2017
f05062e
stagefright: correct timestamp in buffer metadata
Feb 17, 2017
9de83c4
video: Skip wait for audio for video only recording
Feb 14, 2017
e1a5fdc
Merge "stagefright: correct timestamp in buffer metadata"
Feb 22, 2017
898e3d7
Merge "video: Skip wait for audio for video only recording"
Feb 22, 2017
651d97d
Merge "StagefrightRecorder: avoid 30ms offset in pause duration for H…
Feb 23, 2017
a411365
frameworks/av: enable bytestream mode in extractor selectively
Jan 19, 2017
bb3b77c
Promotion of av-aosp.lnx.2.0-00039.
Mar 1, 2017
90a7b12
cameraserver: disable background scheduling of cameraserver
Feb 13, 2017
ecaab0e
video: Skip wait for audio for video only recording
Feb 14, 2017
5933c40
Merge "video: Skip wait for audio for video only recording"
Mar 1, 2017
8ff74c3
NuPlayer: fix possible deadlock due to recursive mutex access
Feb 27, 2017
08cdbb6
video: Disable sync frame decoder mode for closest seek
Mar 7, 2017
e4a9d3a
Promotion of av-aosp.lnx.2.0-00040.
Mar 8, 2017
67d97be
Merge "NuPlayerRenderer: update mAnchorTimeMediaUs on new audio time"
Mar 8, 2017
800ee79
Promotion of av-aosp.lnx.2.0-00041.
Mar 12, 2017
17204db
Camera: Add NULL check on mDevice to avoid crash.
mridulsingh86 Mar 1, 2017
5c3b35c
stagefright: Remove extra memcpy
Mar 14, 2017
ca5fcde
Don't initialize sync sample parameters until the end
marcone Jan 12, 2017
cdea9bf
DO NOT MERGE - improve audio effect framwework thread safety
Dec 1, 2016
2fa34e1
Audio: Make sure effects are enabled for PCM offload
Mar 13, 2017
efc2c73
DO NOT MERGE - audioflinger: fix recursive mutex lock in EffectHandle.
Dec 15, 2016
6e8d3ae
avc_utils: skip empty NALs from malformed bistreams
rjsh Jan 25, 2017
f5df103
Turn off overflow protection for various math functions
marcone Feb 1, 2017
c53ca7a
Merge 800ee797556d71869b92cfbc94a71c26abf1f5a8 on remote branch
Mar 17, 2017
55ba1de
Merge "DO NOT MERGE - improve audio effect framwework thread safety"
Mar 17, 2017
ad16c15
Promotion of av-aosp.lnx.2.0-00043.
Mar 18, 2017
e24c84c
soundtrigger: Modify conditional check in detach
Feb 28, 2017
6d010b4
audiopolicy: return proper devices from getDevicesForStream
Mar 14, 2017
e026e4e
audiopolicy: Invalidate direct PCM tracks when mono is set
Mar 6, 2017
f18f3c0
Merge "audiopolicy: return proper devices from getDevicesForStream"
Mar 24, 2017
b79c4e2
Merge "audiopolicy: Invalidate direct PCM tracks when mono is set"
Mar 24, 2017
0ac7c14
Merge "Audio: Make sure effects are enabled for PCM offload"
Mar 24, 2017
6d7262b
Merge "Turn off overflow protection for various math functions"
Mar 24, 2017
25799d5
Promotion of av-aosp.lnx.2.0-00044.
Mar 26, 2017
416b16f
Promotion of av-aosp.lnx.2.0-00045.
Mar 27, 2017
def0878
stagefright: stop audio encoding before releasing writer thread
Feb 27, 2017
b117b6f
Merge 416b16f49a4a20e12e5556063bb80a03989ce64e on remote branch
Mar 30, 2017
0eeaa1c
Revert "audiopolicy: return proper devices from getDevicesForStream"
Apr 2, 2017
b15db1a
Merge "NuPlayer: fix possible deadlock due to recursive mutex access"
Apr 4, 2017
e79f88e
Merge "stagefright: stop audio encoding before releasing writer thread"
Apr 4, 2017
1e93ed8
Merge "Revert "audiopolicy: return proper devices from getDevicesForS…
Apr 4, 2017
6dceb86
Promotion of av-aosp.lnx.2.0-00046.
Apr 5, 2017
056da37
Merge "video: Disable sync frame decoder mode for closest seek" into …
Apr 6, 2017
46922cb
Merge "stagefright: Remove extra memcpy" into av-aosp.lnx.2.0-dev
Apr 6, 2017
8b38acd
N-MR2 N2G47H merge '220f9a066552359b0f96c27cdbd7ca35160bcbc6' - confl…
Apr 6, 2017
e591336
Promotion of av-aosp.lnx.2.0-00048.
Apr 7, 2017
71d760b
Revert "audiopolicy: return proper devices from getDevicesForStream"
Apr 2, 2017
0519318
Merge e5913368d0b42092a6e996b05debeb3bd83594cd on remote branch
Apr 19, 2017
7a151d6
audiopolicy: Do not select A2DP device if suspended
Apr 7, 2017
2ce011d
media : Changing time stamp manipulation in HFR recording.
Mar 9, 2017
4a30544
Promotion of av-aosp.lnx.2.0-00050.
May 3, 2017
118f4a4
audio: hold effect mutex when releasing effect engine
Apr 12, 2017
75c28ca
libmedia: synchronize access to meta
May 4, 2017
1c3c96e
Merge "media : Changing time stamp manipulation in HFR recording."
lnxbuild May 4, 2017
ccda08c
stagefright: MPEG4Writer: Skip wait for audio in few conditions
Apr 26, 2017
ace33e5
NuPlayer: Decoder: Check for valid codec on resume
Oct 21, 2015
c7652c3
Validate lengths in HEVC metadata parsing
rbessick4 Feb 24, 2017
d358559
FLACExtractor: copy protect mWriteBuffer
rjsh Oct 24, 2016
30d6003
Fix integer overflow and divide-by-zero
marcone Mar 9, 2017
8330df2
Fix out of bounds access
marcone Mar 10, 2017
64702ed
Fix NPDs in h263 decoder
marcone Mar 3, 2017
4d12b0a
Add bounds check in SoftAACEncoder2::onQueueFilled()
rbessick4 Mar 13, 2017
5eae13e
AudioFlinger: Check framecount overflow when creating track
xt0032rus Feb 14, 2017
236c935
Merge "FLACExtractor: copy protect mWriteBuffer"
lnxbuild May 9, 2017
d22486e
Promotion of av-aosp.lnx.2.0-00051.
May 9, 2017
d97375f
stagefright: don't assume 16 bit format
May 9, 2017
4b266b6
Merge 4a305445de49fa1effb646b6753530ff83fefb9c on remote branch
May 10, 2017
71e174e
Promotion of av-aosp.lnx.2.0-00052.
May 11, 2017
3db0d31
audio: resize resampler's inframe buffer independent of out buffer
May 11, 2017
6085e77
Merge "AudioFlinger: Check framecount overflow when creating track"
lnxbuild May 12, 2017
d76eb61
Merge "libmedia: synchronize access to meta"
lnxbuild May 12, 2017
815c045
Promotion of av-aosp.lnx.2.0-00053.
May 13, 2017
c2996fb
Merge "stagefright: don't assume 16 bit format"
lnxbuild May 13, 2017
b9c0872
Promotion of av-aosp.lnx.2.0-00054.
May 14, 2017
6734851
media: Modify timestamps for HFR use case
May 1, 2017
5ba62bc
Merge "audio: resize resampler's inframe buffer independent of out bu…
lnxbuild May 18, 2017
0c9699a
Merge "stagefright: MPEG4Writer: Skip wait for audio in few conditions"
lnxbuild May 18, 2017
adde40e
Promotion of av-aosp.lnx.2.0-00055.
May 18, 2017
8d049dd
Merge "media: Modify timestamps for HFR use case"
lnxbuild May 24, 2017
fdd3bdd
Promotion of av-aosp.lnx.2.0-00056.
May 25, 2017
cb1fc55
Merge adde40e18db2085ea3acc27ec75657a5c8ae8f20 on remote branch
May 26, 2017
5b68a20
Merge fdd3bddea664ff56a70001a4d67bf3b91da4c9db on remote branch
Jun 13, 2017
ce5f5fa
Camera: Skip stream size check for whitelisted apps.
Jun 21, 2017
8b91300
Don't allow using or allocating a buffer after the first state transi…
marcone Mar 27, 2017
c0008c6
Prevent OOB write in soft_avc encoder
rbessick4 May 10, 2017
b352d00
Limit ogg packet size
marcone May 12, 2017
cb21e81
Fix memory leak in error case
marcone May 12, 2017
a31514f
Modifying MetaData invalidates previous char*
marcone May 15, 2017
cd60a5e
Merge "Limit ogg packet size"
lnxbuild Jul 27, 2017
726a259
Merge "Modifying MetaData invalidates previous char*"
lnxbuild Jul 27, 2017
3fdcf7a
Promotion of av-aosp.lnx.2.0-00057.
Jul 31, 2017
8ca35fd
Merge 3fdcf7a2630260d2d76f7c930a0f5f1a6593bc1c on remote branch
Aug 3, 2017
677e898
Merge tag 'LA.UM.5.8.r1-02700-8x98.0' of https://source.codeaurora.or…
vibhoothi Aug 25, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion camera/cameraserver/cameraserver.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ service cameraserver /system/bin/cameraserver
user cameraserver
group audio camera input drmrpc
ioprio rt 4
writepid /dev/cpuset/camera-daemon/tasks /dev/stune/top-app/tasks
writepid /dev/cpuset/camera-daemon/tasks /dev/stune/foreground/tasks
3 changes: 2 additions & 1 deletion include/media/IMediaExtractorService.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class IMediaExtractorService: public IInterface
public:
DECLARE_META_INTERFACE(MediaExtractorService);

virtual sp<IMediaExtractor> makeExtractor(const sp<IDataSource> &source, const char *mime) = 0;
virtual sp<IMediaExtractor> makeExtractor(const sp<IDataSource> &source, const char *mime,
const uint32_t extFlags) = 0;

};

Expand Down
2 changes: 2 additions & 0 deletions include/media/stagefright/CameraSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ class CameraSource : public MediaSource, public MediaBufferObserver {

virtual void signalBufferReturned(MediaBuffer* buffer);

virtual void notifyPerformanceMode() {}

protected:

/**
Expand Down
2 changes: 1 addition & 1 deletion include/media/stagefright/ExtendedMediaDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ extern const char *MEDIA_MIMETYPE_VIDEO_MPEG4_DP;
extern const char *MEDIA_MIMETYPE_AUDIO_DSD;
extern const char *MEDIA_MIMETYPE_CONTAINER_DSF;
extern const char *MEDIA_MIMETYPE_CONTAINER_DFF;

extern const char *MEDIA_MIMETYPE_CONTAINER_MOV;

} // namespace android

Expand Down
4 changes: 4 additions & 0 deletions include/media/stagefright/MPEG4Writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ class MPEG4Writer : public MediaWriter {

static uint32_t getMpeg4Time();

int64_t mLastAudioTimeStampUs;
void setLastAudioTimeStamp(int64_t ts) {mLastAudioTimeStampUs = ts;}
int64_t getLastAudioTimeStamp() {return mLastAudioTimeStampUs;}

MPEG4Writer(const MPEG4Writer &);
MPEG4Writer &operator=(const MPEG4Writer &);
};
Expand Down
6 changes: 6 additions & 0 deletions include/media/stagefright/MediaCodecSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ struct MediaCodecSource : public MediaSource,
// for AHandlerReflector
void onMessageReceived(const sp<AMessage> &msg);

void notifyPerformanceMode();

protected:
virtual ~MediaCodecSource();

Expand Down Expand Up @@ -145,6 +147,10 @@ struct MediaCodecSource : public MediaSource,

int32_t mGeneration;

int64_t mPrevBufferTimestampUs;
bool mIsHFR;
int32_t mBatchSize;

DISALLOW_EVIL_CONSTRUCTORS(MediaCodecSource);
};

Expand Down
8 changes: 6 additions & 2 deletions include/media/stagefright/MediaExtractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ class MetaData;
class MediaExtractor : public BnMediaExtractor {
public:
static sp<IMediaExtractor> Create(
const sp<DataSource> &source, const char *mime = NULL);
const sp<DataSource> &source, const char *mime = NULL,
const uint32_t flags = 0);
static sp<MediaExtractor> CreateFromService(
const sp<DataSource> &source, const char *mime = NULL);
const sp<DataSource> &source, const char *mime = NULL,
const uint32_t flags = 0);

virtual size_t countTracks() = 0;
virtual sp<IMediaSource> getTrack(size_t index) = 0;
Expand Down Expand Up @@ -73,6 +75,8 @@ class MediaExtractor : public BnMediaExtractor {

virtual const char * name() { return "<unspecified>"; }

virtual void setExtraFlags(uint32_t flags) {}

protected:
MediaExtractor();
virtual ~MediaExtractor() {}
Expand Down
6 changes: 6 additions & 0 deletions media/audioserver/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,10 @@ ifeq ($(strip $(DOLBY_ENABLE)),true)
endif
# DOLBY_END

ifeq ($(strip $(SPATIAL_AUDIO_ENABLED)), true)
LOCAL_CFLAGS += -DVRAUDIOSERVICE_ENABLE
LOCAL_C_INCLUDES += $(vr_audio_includes)
LOCAL_SHARED_LIBRARIES += libvraudio
endif

include $(BUILD_EXECUTABLE)
7 changes: 7 additions & 0 deletions media/audioserver/main_audioserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
#include "DolbyMemoryService.h"
#endif

#ifdef VRAUDIOSERVICE_ENABLE
#include "VRAudioService.h"
#endif

using namespace android;

int main(int argc __unused, char **argv)
Expand Down Expand Up @@ -154,6 +158,9 @@ int main(int argc __unused, char **argv)
DolbyMemoryService::instantiate();
#endif
SoundTriggerHwService::instantiate();
#ifdef VRAUDIOSERVICE_ENABLE
VRAudioServiceNative::instantiate();
#endif
ProcessState::self()->startThreadPool();
IPCThreadState::self()->joinThreadPool();
}
Expand Down
3 changes: 2 additions & 1 deletion media/libavextensions/mediaplayerservice/AVNuExtensions.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 - 2016, The Linux Foundation. All rights reserved.
* Copyright (c) 2013 - 2017, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -75,6 +75,7 @@ struct AVNuUtils {
virtual audio_format_t getPCMFormat(const sp<AMessage> &);
virtual void setCodecOutputFormat(const sp<AMessage> &);
virtual bool isByteStreamModeEnabled(const sp<MetaData> &);
virtual uint32_t getFlags();

// ----- NO TRESSPASSING BEYOND THIS LINE ------
DECLARE_LOADABLE_SINGLETON(AVNuUtils);
Expand Down
6 changes: 5 additions & 1 deletion media/libavextensions/mediaplayerservice/AVNuUtils.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 - 2016, The Linux Foundation. All rights reserved.
* Copyright (c) 2013 - 2017, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -103,6 +103,10 @@ bool AVNuUtils::isByteStreamModeEnabled(const sp<MetaData> &) {
}
#endif

uint32_t AVNuUtils::getFlags() {
return 0;
}

// ----- NO TRESSPASSING BEYOND THIS LINE ------
AVNuUtils::AVNuUtils() {}

Expand Down
8 changes: 6 additions & 2 deletions media/libavextensions/stagefright/AVExtensions.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 - 2016, The Linux Foundation. All rights reserved.
* Copyright (c) 2013 - 2017, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -35,6 +35,7 @@
#include <media/IOMX.h>
#include <camera/android/hardware/ICamera.h>
#include <media/mediarecorder.h>
#include <media/stagefright/MediaCodecSource.h>
#include "ESQueue.h"

namespace android {
Expand All @@ -60,7 +61,8 @@ struct AudioSource;
struct AVFactory {
virtual sp<ACodec> createACodec();
virtual MediaExtractor* createExtendedExtractor(
const sp<DataSource> &source, const char *mime, const sp<AMessage> &meta);
const sp<DataSource> &source, const char *mime, const sp<AMessage> &meta,
const uint32_t flags);
virtual ElementaryStreamQueue* createESQueue(
ElementaryStreamQueue::Mode mode, uint32_t flags = 0);
virtual CameraSource *CreateCameraSourceFromCamera(
Expand Down Expand Up @@ -152,6 +154,8 @@ struct AVUtils {

virtual bool isAudioMuxFormatSupported(const char *mime);
virtual void cacheCaptureBuffers(sp<hardware::ICamera> camera, video_encoder encoder);
virtual void getHFRParams(bool*, int32_t*, sp<AMessage>);
virtual int64_t overwriteTimeOffset(bool, int64_t, int64_t *, int64_t, int32_t);
virtual const char *getCustomCodecsLocation();
virtual const char *getCustomCodecsPerformanceLocation();

Expand Down
5 changes: 3 additions & 2 deletions media/libavextensions/stagefright/AVFactory.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 - 2016, The Linux Foundation. All rights reserved.
* Copyright (c) 2013 - 2017, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -54,7 +54,8 @@ sp<ACodec> AVFactory::createACodec() {
}

MediaExtractor* AVFactory::createExtendedExtractor(
const sp<DataSource> &, const char *, const sp<AMessage> &) {
const sp<DataSource> &, const char *, const sp<AMessage> &,
const uint32_t) {
return NULL;
}

Expand Down
11 changes: 10 additions & 1 deletion media/libavextensions/stagefright/AVUtils.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 - 2016, The Linux Foundation. All rights reserved.
* Copyright (c) 2013 - 2017, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -135,6 +135,15 @@ void AVUtils::cacheCaptureBuffers(sp<hardware::ICamera>, video_encoder) {
return;
}

void AVUtils::getHFRParams(bool*, int32_t*, sp<AMessage>) {
return;
}

int64_t AVUtils::overwriteTimeOffset(bool, int64_t inputBufferTimeOffsetUs, int64_t*,
int64_t, int32_t) {
return inputBufferTimeOffsetUs;
}

const char *AVUtils::getCustomCodecsLocation() {
return "/etc/media_codecs.xml";
}
Expand Down
2 changes: 1 addition & 1 deletion media/libavextensions/stagefright/ExtendedMediaDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ const char *MEDIA_MIMETYPE_VIDEO_MPEG4_DP = "video/mp4v-esdp";
const char *MEDIA_MIMETYPE_CONTAINER_DSF = "audio/x-dsf"; // For DSF clip
const char *MEDIA_MIMETYPE_CONTAINER_DFF = "audio/x-dff"; // For DFF or DIF clip
const char *MEDIA_MIMETYPE_AUDIO_DSD = "audio/dsd";

const char *MEDIA_MIMETYPE_CONTAINER_MOV = "video/quicktime"; //mov clip

} // namespace android
6 changes: 3 additions & 3 deletions media/libmedia/AudioRecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ status_t AudioRecord::set(
// TODO: add audio hardware input latency here
if (mTransfer == TRANSFER_CALLBACK ||
mTransfer == TRANSFER_SYNC) {
mLatency = (1000 * mNotificationFramesAct) / sampleRate;
mLatency = (1000 * mNotificationFramesAct) / mSampleRate;
} else {
mLatency = (1000 * mFrameCount) / sampleRate;
mLatency = (1000 * mFrameCount) / mSampleRate;
}
mMarkerPosition = 0;
mMarkerReached = false;
Expand Down Expand Up @@ -875,7 +875,7 @@ audio_io_handle_t AudioRecord::getInputPrivate() const

ssize_t AudioRecord::read(void* buffer, size_t userSize, bool blocking)
{
if (mTransfer != TRANSFER_SYNC) {
if ((mTransfer != TRANSFER_SYNC) || !mActive) {
return INVALID_OPERATION;
}

Expand Down
8 changes: 6 additions & 2 deletions media/libmedia/IMediaExtractorService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ class BpMediaExtractorService : public BpInterface<IMediaExtractorService>
{
}

virtual sp<IMediaExtractor> makeExtractor(const sp<IDataSource> &source, const char *mime) {
virtual sp<IMediaExtractor> makeExtractor(const sp<IDataSource> &source, const char *mime,
const uint32_t extFlags) {
Parcel data, reply;
data.writeInterfaceToken(IMediaExtractorService::getInterfaceDescriptor());
data.writeStrongBinder(IInterface::asBinder(source));
data.writeUint32(extFlags);
if (mime != NULL) {
data.writeCString(mime);
}
Expand Down Expand Up @@ -75,8 +77,10 @@ status_t BnMediaExtractorService::onTransact(
// for MediaBuffers for this process.
MediaBuffer::useSharedMemory();
sp<IDataSource> source = interface_cast<IDataSource>(b);
uint32_t extFlags;
data.readUint32(&extFlags);
const char *mime = data.readCString();
sp<IMediaExtractor> ex = makeExtractor(source, mime);
sp<IMediaExtractor> ex = makeExtractor(source, mime, extFlags);
reply->writeStrongBinder(IInterface::asBinder(ex));
return NO_ERROR;
}
Expand Down
15 changes: 13 additions & 2 deletions media/libmediaplayerservice/StagefrightRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <inttypes.h>
#include <utils/Log.h>

#include <cutils/properties.h>
#include <inttypes.h>
#include "WebmWriter.h"
#include "StagefrightRecorder.h"
Expand Down Expand Up @@ -1464,7 +1465,7 @@ status_t StagefrightRecorder::setupCameraSource(
Size videoSize;
videoSize.width = mVideoWidth;
videoSize.height = mVideoHeight;
if (mCaptureFpsEnable) {
if (mCaptureFpsEnable && mCaptureFps != mFrameRate ) {
if (mTimeBetweenCaptureUs < 0) {
ALOGE("Invalid mTimeBetweenTimeLapseFrameCaptureUs value: %" PRId64 "",
mTimeBetweenCaptureUs);
Expand All @@ -1477,10 +1478,11 @@ status_t StagefrightRecorder::setupCameraSource(
mTimeBetweenCaptureUs);
*cameraSource = mCameraSourceTimeLapse;
} else {
*cameraSource = AVFactory::get()->CreateCameraSourceFromCamera(
mCameraSource = AVFactory::get()->CreateCameraSourceFromCamera(
mCamera, mCameraProxy, mCameraId, mClientName, mClientUid, mClientPid,
videoSize, mFrameRate,
mPreviewSurface);
*cameraSource = mCameraSource;
}
AVUtils::get()->cacheCaptureBuffers(mCamera, mVideoEncoder);
mCamera.clear();
Expand Down Expand Up @@ -1609,6 +1611,7 @@ status_t StagefrightRecorder::setupVideoEncoder(
preferBFrames = false;
tsLayers = 2; // use at least two layers as resulting video will likely be sped up
} else if (mCaptureFps > maxPlaybackFps) { // slow-mo
format->setInt32("high-frame-rate", 1);
maxPlaybackFps = mCaptureFps; // assume video will be played back at full capture speed
preferBFrames = false;
}
Expand Down Expand Up @@ -1882,6 +1885,13 @@ status_t StagefrightRecorder::stop() {
mCameraSourceTimeLapse = NULL;
}

if (mVideoEncoderSource != NULL) {
mVideoEncoderSource->notifyPerformanceMode();
}
if (mCameraSource != NULL) {
mCameraSource->notifyPerformanceMode();
}

if (mWriter != NULL) {
err = mWriter->stop();
mWriter.clear();
Expand Down Expand Up @@ -1960,6 +1970,7 @@ status_t StagefrightRecorder::reset() {
mCaptureFps = 0.0f;
mTimeBetweenCaptureUs = -1;
mCameraSourceTimeLapse = NULL;
mCameraSource = NULL;
mMetaDataStoredInVideoBuffers = kMetadataBufferTypeInvalid;
mEncoderProfiles = MediaProfiles::getInstance();
mRotationDegrees = 0;
Expand Down
1 change: 1 addition & 0 deletions media/libmediaplayerservice/StagefrightRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ struct StagefrightRecorder : public MediaRecorderBase {
float mCaptureFps;
int64_t mTimeBetweenCaptureUs;
sp<CameraSourceTimeLapse> mCameraSourceTimeLapse;
sp<CameraSource> mCameraSource;

String8 mParams;

Expand Down
3 changes: 2 additions & 1 deletion media/libmediaplayerservice/nuplayer/GenericSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ status_t NuPlayer::GenericSource::initFromDataSource() {
extractor = mWVMExtractor;
} else {
extractor = MediaExtractor::Create(mDataSource,
mimeType.isEmpty() ? NULL : mimeType.string());
mimeType.isEmpty() ? NULL : mimeType.string(),
mIsStreaming ? 0 : AVNuUtils::get()->getFlags());
}

if (extractor == NULL) {
Expand Down
6 changes: 4 additions & 2 deletions media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,10 +1132,10 @@ void NuPlayer::Renderer::onNewAudioMediaTime(int64_t mediaTimeUs) {
if (nowUs >= mNextAudioClockUpdateTimeUs) {
int64_t nowMediaUs = mediaTimeUs - getPendingAudioPlayoutDurationUs(nowUs);
mMediaClock->updateAnchor(nowMediaUs, nowUs, mediaTimeUs);
mAnchorTimeMediaUs = mediaTimeUs;
mUseVirtualAudioSink = false;
mNextAudioClockUpdateTimeUs = nowUs + kMinimumAudioClockUpdatePeriodUs;
}
mAnchorTimeMediaUs = mediaTimeUs;
} else {
int64_t unused;
if ((mMediaClock->getMediaTime(nowUs, &unused) != OK)
Expand Down Expand Up @@ -1792,10 +1792,12 @@ void NuPlayer::Renderer::onAudioTearDown(AudioTearDownReason reason) {

void NuPlayer::Renderer::startAudioOffloadPauseTimeout() {
if (offloadingAudio()) {
int64_t pauseTimeOutDuration = property_get_int64(
"audio.offload.pstimeout.secs",(kOffloadPauseMaxUs/1000000)/*default*/);
mWakeLock->acquire();
sp<AMessage> msg = new AMessage(kWhatAudioOffloadPauseTimeout, this);
msg->setInt32("drainGeneration", mAudioOffloadPauseTimeoutGeneration);
msg->post(kOffloadPauseMaxUs);
msg->post(pauseTimeOutDuration*1000000);
}
}

Expand Down
Loading