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.NonNull;
20 import android.annotation.SystemApi;
21 
22 /**
23  * Filter event sent from {@link Filter} objects for Timed External Media Information (TEMI) data.
24  *
25  * @hide
26  */
27 @SystemApi
28 public class TemiEvent extends FilterEvent {
29     private final long mPts;
30     private final byte mDescrTag;
31     private final byte[] mDescrData;
32 
33     // This constructor is used by JNI code only
TemiEvent(long pts, byte descrTag, byte[] descrData)34     private TemiEvent(long pts, byte descrTag, byte[] descrData) {
35         mPts = pts;
36         mDescrTag = descrTag;
37         mDescrData = descrData;
38     }
39 
40 
41     /**
42      * Gets PTS (Presentation Time Stamp) for audio or video frame.
43      */
getPts()44     public long getPts() {
45         return mPts;
46     }
47 
48     /**
49      * Gets TEMI (Timed External Media Information) descriptor tag.
50      */
getDescriptorTag()51     public byte getDescriptorTag() {
52         return mDescrTag;
53     }
54 
55     /**
56      * Gets TEMI (Timed External Media Information) descriptor.
57      */
58     @NonNull
getDescriptorData()59     public byte[] getDescriptorData() {
60         return mDescrData;
61     }
62 }
63