1 /*****************************************************************************
2  * Copyright (C) 2013-2020 MulticoreWare, Inc
3  *
4  * Authors: Steve Borho <steve@borho.org>
5  *          Xinyue Lu <i@7086.in>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
20  *
21  * This program is also available under a commercial proprietary license.
22  * For more information, contact us at license @ x265.com.
23  *****************************************************************************/
24 
25 #ifndef X265_HEVC_RAW_H
26 #define X265_HEVC_RAW_H
27 
28 #include "output.h"
29 #include "common.h"
30 #include <fstream>
31 #include <iostream>
32 
33 namespace X265_NS {
34 class RAWOutput : public OutputFile
35 {
36 protected:
37 
38     FILE* ofs;
39 
40     bool b_fail;
41 
42 public:
43 
44     RAWOutput(const char* fname, InputFileInfo&);
45 
isFail()46     bool isFail() const { return b_fail; }
47 
needPTS()48     bool needPTS() const { return false; }
49 
release()50     void release() { delete this; }
51 
getName()52     const char* getName() const { return "raw"; }
53 
54     void setParam(x265_param* param);
55 
56     int writeHeaders(const x265_nal* nal, uint32_t nalcount);
57 
58     int writeFrame(const x265_nal* nal, uint32_t nalcount, x265_picture&);
59 
60     void closeFile(int64_t largest_pts, int64_t second_largest_pts);
61 };
62 }
63 
64 #endif // ifndef X265_HEVC_RAW_H
65