1343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih/*
2343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih * Copyright (C) 2014 The Android Open Source Project
3343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih *
4343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih * Licensed under the Apache License, Version 2.0 (the "License");
5343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih * you may not use this file except in compliance with the License.
6343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih * You may obtain a copy of the License at
7343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih *
8343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih *      http://www.apache.org/licenses/LICENSE-2.0
9343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih *
10343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih * Unless required by applicable law or agreed to in writing, software
11343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih * distributed under the License is distributed on an "AS IS" BASIS,
12343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih * See the License for the specific language governing permissions and
14343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih * limitations under the License.
15343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih */
16343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih
17343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih#ifndef WEBMFRAME_H_
18343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih#define WEBMFRAME_H_
19343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih
20343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih#include "WebmElement.h"
21343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih
22343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shihnamespace android {
23343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih
24343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shihstruct WebmFrame : LightRefBase<WebmFrame> {
25343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shihpublic:
26343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih    const int mType;
27343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih    const bool mKey;
28343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih    const uint64_t mAbsTimecode;
29343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih    const sp<ABuffer> mData;
30343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih    const bool mEos;
31343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih
32343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih    WebmFrame();
33343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih    WebmFrame(int type, bool key, uint64_t absTimecode, MediaBuffer *buf);
34343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih    ~WebmFrame() {}
35343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih
36343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih    sp<WebmElement> SimpleBlock(uint64_t baseTimecode) const;
37343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih
38343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih    bool operator<(const WebmFrame &other) const;
39343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih
40343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih    static const sp<WebmFrame> EOS;
41343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shihprivate:
42343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih    DISALLOW_EVIL_CONSTRUCTORS(WebmFrame);
43343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih};
44343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih
45343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih} /* namespace android */
46343947abc8b7c126f966fd32a0b18bff6c2cecd1Robert Shih#endif /* WEBMFRAME_H_ */
47