1 | /********** |
2 | This library is free software; you can redistribute it and/or modify it under |
3 | the terms of the GNU Lesser General Public License as published by the |
4 | Free Software Foundation; either version 3 of the License, or (at your |
5 | option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.) |
6 | |
7 | This library is distributed in the hope that it will be useful, but WITHOUT |
8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for |
10 | more details. |
11 | |
12 | You should have received a copy of the GNU Lesser General Public License |
13 | along with this library; if not, write to the Free Software Foundation, Inc., |
14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
15 | **********/ |
16 | // "liveMedia" |
17 | // Copyright (c) 1996-2020 Live Networks, Inc. All rights reserved. |
18 | // H.265 Video File sinks |
19 | // Implementation |
20 | |
21 | #include "H265VideoFileSink.hh" |
22 | #include "OutputFile.hh" |
23 | |
24 | ////////// H265VideoFileSink ////////// |
25 | |
26 | H265VideoFileSink |
27 | ::H265VideoFileSink(UsageEnvironment& env, FILE* fid, |
28 | char const* sPropVPSStr, |
29 | char const* sPropSPSStr, |
30 | char const* sPropPPSStr, |
31 | unsigned bufferSize, char const* perFrameFileNamePrefix) |
32 | : H264or5VideoFileSink(env, fid, bufferSize, perFrameFileNamePrefix, |
33 | sPropVPSStr, sPropSPSStr, sPropPPSStr) { |
34 | } |
35 | |
36 | H265VideoFileSink::~H265VideoFileSink() { |
37 | } |
38 | |
39 | H265VideoFileSink* |
40 | H265VideoFileSink::createNew(UsageEnvironment& env, char const* fileName, |
41 | char const* sPropVPSStr, |
42 | char const* sPropSPSStr, |
43 | char const* sPropPPSStr, |
44 | unsigned bufferSize, Boolean oneFilePerFrame) { |
45 | do { |
46 | FILE* fid; |
47 | char const* perFrameFileNamePrefix; |
48 | if (oneFilePerFrame) { |
49 | // Create the fid for each frame |
50 | fid = NULL; |
51 | perFrameFileNamePrefix = fileName; |
52 | } else { |
53 | // Normal case: create the fid once |
54 | fid = OpenOutputFile(env, fileName); |
55 | if (fid == NULL) break; |
56 | perFrameFileNamePrefix = NULL; |
57 | } |
58 | |
59 | return new H265VideoFileSink(env, fid, sPropVPSStr, sPropSPSStr, sPropPPSStr, bufferSize, perFrameFileNamePrefix); |
60 | } while (0); |
61 | |
62 | return NULL; |
63 | } |
64 | |