1# Fuzzer for libmediaplayerservice
2## Table of contents
3+ [StagefrightMediaRecorder](#StagefrightMediaRecorder)
4+ [StagefrightMetadataRetriever](#StagefrightMetadataRetriever)
5+ [MediaPlayer](#MediaPlayer)
6
7# <a name="StagefrightMediaRecorder"></a> Fuzzer for StagefrightMediaRecorder
8
9StagefrightMediaRecorder supports the following parameters:
101. Output Formats (parameter name: `setOutputFormat`)
112. Audio Encoders (parameter name: `setAudioEncoder`)
123. Video Encoders (parameter name: `setVideoEncoder`)
134. Audio Sources (parameter name: `setAudioSource`)
145. Video Sources (parameter name: `setVideoSource`)
156. Microphone Direction (parameter name: `setMicrophoneDirection`)
16
17You can find the possible values in the fuzzer's source code.
18
19#### Steps to run
201. Build the fuzzer
21```
22  $ mm -j$(nproc) mediarecorder_fuzzer
23```
242. Run on device
25```
26  $ adb sync data
27  $ adb shell /data/fuzz/arm64/mediarecorder_fuzzer/mediarecorder_fuzzer
28```
29
30# <a name="StagefrightMetadataRetriever"></a> Fuzzer for StagefrightMetadataRetriever
31
32StagefrightMetadataRetriever supports the following data sources:
331. Url (parameter name: `url`)
342. File descriptor (parameter name: `fd`)
353. DataSource (parameter name: `source`)
36
37| Parameter| Valid Values| Configured Value|
38|------------- |-------------| ----- |
39| `url` | Url of data source | Value obtained from FuzzedDataProvider |
40| `fd` | File descriptor value of input file | Value obtained from FuzzedDataProvider |
41| `source` | DataSource object | Data obtained from FuzzedDataProvider |
42
43#### Steps to run
441. Build the fuzzer
45```
46  $ mm -j$(nproc) metadataretriever_fuzzer
47```
482. To run on device
49```
50  $ adb sync data
51  $ adb shell /data/fuzz/arm64/metadataretriever_fuzzer/metadataretriever_fuzzer
52```
53
54# <a name="MediaPlayer"></a> Fuzzer for MediaPlayer
55
56MediaPlayerService supports the following data sources:
571. Url (parameter name: `url`)
582. File descriptor (parameter name: `fd`)
593. IStreamSource  (parameter name: `source`)
604. IDataSource (parameter name: `source`)
615. RTP Parameters  (parameter name: `rtpParams`)
62
63MediaPlayerService supports the following parameters:
641. Audio sessions (parameter name: `audioSessionId`)
652. Audio stretch modes (parameter name: `mStretchMode`)
663. Audio fallback modes  (parameter name: `mFallbackMode`)
674. Media parameter keys (parameter name: `key`)
685. Audio Stream Types (parameter name: `streamType`)
696. Media Event Types (parameter name: `msg`)
707. Media Info Types (parameter name: `ext1`)
71
72You can find the possible values in the fuzzer's source code.
73
74#### Steps to run
751. Build the fuzzer
76```
77  $ mm -j$(nproc) mediaplayer_fuzzer
78```
792. To run on device
80```
81  $ adb sync data
82  $ adb shell /data/fuzz/arm64/mediaplayer_fuzzer/mediaplayer_fuzzer
83```
84