Commit fa3e530b authored by John Koleszar's avatar John Koleszar
Browse files

vpxenc: get version string programatically

To avoid a dependency on vpx_version.h, call the vpx_codec_version_str()
function and build up the string manually.

Change-Id: Ie650e9b8f2aaaffaa31da5e9ef3b566b972321b4
parent 4a6ac727
......@@ -32,7 +32,6 @@
#include <fcntl.h>
#include <unistd.h>
#endif
#include "vpx_version.h"
#include "vpx/vp8cx.h"
#include "vpx_ports/mem_ops.h"
#include "vpx_ports/vpx_timer.h"
......@@ -624,6 +623,18 @@ write_webm_seek_info(EbmlGlobal *ebml)
//segment info
EbmlLoc startInfo;
uint64_t frame_time;
char version_string[64];
/* Assemble version string */
if(ebml->debug)
strcpy(version_string, "vpxenc");
else
{
strcpy(version_string, "vpxenc ");
strncat(version_string,
vpx_codec_version_str(),
sizeof(version_string) - 1 - strlen(version_string));
}
frame_time = (uint64_t)1000 * ebml->framerate.den
/ ebml->framerate.num;
......@@ -632,10 +643,8 @@ write_webm_seek_info(EbmlGlobal *ebml)
Ebml_SerializeUnsigned(ebml, TimecodeScale, 1000000);
Ebml_SerializeFloat(ebml, Segment_Duration,
ebml->last_pts_ms + frame_time);
Ebml_SerializeString(ebml, 0x4D80,
ebml->debug ? "vpxenc" : "vpxenc" VERSION_STRING);
Ebml_SerializeString(ebml, 0x5741,
ebml->debug ? "vpxenc" : "vpxenc" VERSION_STRING);
Ebml_SerializeString(ebml, 0x4D80, version_string);
Ebml_SerializeString(ebml, 0x5741, version_string);
Ebml_EndSubElement(ebml, &startInfo);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment