MCPcopy Create free account
hub / github.com/dirkvdb/ffmpegthumbnailer / initialize

Method initialize

libffmpegthumbnailer/moviedecoder.cpp:63–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void MovieDecoder::initialize(const string& filename, bool preferEmbeddedMetadata)
64{
65 avformat_network_init();
66
67 string inputFile = filename == "-" ? "pipe:" : filename;
68 m_AllowSeek = (filename != "-") && (filename.find("rtsp://") != 0) && (filename.find("udp://") != 0);
69
70 if ((!m_FormatContextWasGiven) && avformat_open_input(&m_pFormatContext, inputFile.c_str(), nullptr, nullptr) != 0) {
71 destroy();
72 throw logic_error(string("Could not open input file: ") + filename);
73 }
74
75 if (avformat_find_stream_info(m_pFormatContext, nullptr) < 0) {
76 destroy();
77 throw logic_error("Could not find stream information");
78 }
79
80 initializeVideo(preferEmbeddedMetadata);
81 m_pFrame = av_frame_alloc();
82}
83
84void MovieDecoder::destroy()
85{

Callers 1

generateThumbnailMethod · 0.80

Calls 1

findMethod · 0.80

Tested by

no test coverage detected