1/**********
2This library is free software; you can redistribute it and/or modify it under
3the terms of the GNU Lesser General Public License as published by the
4Free Software Foundation; either version 3 of the License, or (at your
5option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10more details.
11
12You should have received a copy of the GNU Lesser General Public License
13along with this library; if not, write to the Free Software Foundation, Inc.,
1451 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
26H265VideoFileSink
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
36H265VideoFileSink::~H265VideoFileSink() {
37}
38
39H265VideoFileSink*
40H265VideoFileSink::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