1 /* 2 * Copyright 2019 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 package android.media.tv.tuner.filter; 18 19 import android.annotation.IntRange; 20 import android.annotation.SystemApi; 21 22 /** 23 * Filter event sent from {@link Filter} objects with PES type. 24 * 25 * @hide 26 */ 27 @SystemApi 28 public class PesEvent extends FilterEvent { 29 private final int mStreamId; 30 private final int mDataLength; 31 private final int mMpuSequenceNumber; 32 33 // This constructor is used by JNI code only PesEvent(int streamId, int dataLength, int mpuSequenceNumber)34 private PesEvent(int streamId, int dataLength, int mpuSequenceNumber) { 35 mStreamId = streamId; 36 mDataLength = dataLength; 37 mMpuSequenceNumber = mpuSequenceNumber; 38 } 39 40 /** 41 * Gets stream ID. 42 */ getStreamId()43 public int getStreamId() { 44 return mStreamId; 45 } 46 47 /** 48 * Gets data size in bytes of filtered data. 49 */ getDataLength()50 public int getDataLength() { 51 return mDataLength; 52 } 53 54 /** 55 * Gets MPU sequence number of filtered data. 56 */ 57 @IntRange(from = 0) getMpuSequenceNumber()58 public int getMpuSequenceNumber() { 59 return mMpuSequenceNumber; 60 } 61 } 62