1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef MEDIA_KEYS_H_ 18 19 #define MEDIA_KEYS_H_ 20 21 namespace android { 22 23 // When signalling a discontinuity to IStreamListener you can optionally 24 // specify the type(s) of discontinuity, i.e. if the audio format has changed, 25 // the video format has changed, time has jumped or any combination thereof. 26 // To do so, include a non-zero int32_t value under the key 27 // "kIStreamListenerKeyDiscontinuityMask" when issuing the 28 // IStreamListener::DISCONTINUITY command. 29 // If there is a change in audio/video format, The new logical stream 30 // must start with proper codec initialization 31 // information for playback to continue, i.e. SPS and PPS in the case 32 // of AVC video etc. 33 // If this key is not present, only a time discontinuity is assumed. 34 // The value should be a bitmask of values from 35 // ATSParser::DiscontinuityType. 36 extern const char *const kIStreamListenerKeyDiscontinuityMask; 37 38 // When signalling a discontinuity to ATSParser you can optionally 39 // specify an int64_t PTS timestamp in "extra". 40 // If present, rendering of data following the discontinuity 41 // will be suppressed until media time reaches this timestamp. 42 extern const char *const kATSParserKeyResumeAtPTS; 43 44 // When signalling a discontinuity to ATSParser you can optionally 45 // specify an int64_t PTS timestamp in "extra". 46 // It indicates the media time (in us) to be associated 47 // with the next PTS occuring in the stream. The value is of type int64_t. 48 extern const char *const kATSParserKeyMediaTimeUs; 49 50 // When signalling a discontinuity to ATSParser you can optionally 51 // specify an int64_t PTS timestamp in "extra". 52 // It indicates the media time (in us) of a recent 53 // sample from the same content, and is used as a hint for the parser to 54 // handle PTS wraparound. This is required when a new parser is created 55 // to continue parsing content from the same timeline. 56 extern const char *const kATSParserKeyRecentMediaTimeUs; 57 58 } // namespace android 59 60 #endif // MEDIA_KEYS_H_ 61