mkvmuxer: Revert changes to IMkvWriter types.

- Restore integer typedefs in mkvmuxertypes.h.
- Revert integer type changes in IMkvWriter declaration.
- Revert integer type changes in mkvwriter.{cc,h}

Change-Id: I3e9f8a3d079f485a3ea051f7477c803f9c9087e4
This commit is contained in:
Tom Finegan 2016-04-08 09:55:35 -07:00
parent 030518edd3
commit 784b6fe4fe
4 changed files with 21 additions and 12 deletions

View File

@ -37,14 +37,14 @@ const uint64_t kMaxTrackNumber = 126;
class IMkvWriter {
public:
// Writes out |len| bytes of |buf|. Returns 0 on success.
virtual int32_t Write(const void* buf, uint32_t len) = 0;
virtual int32 Write(const void* buf, uint32 len) = 0;
// Returns the offset of the output position from the beginning of the
// output.
virtual int64_t Position() const = 0;
virtual int64 Position() const = 0;
// Set the current File position. Returns 0 on success.
virtual int32_t Position(int64_t position) = 0;
virtual int32 Position(int64 position) = 0;
// Returns true if the writer is seekable.
virtual bool Seekable() const = 0;
@ -54,7 +54,7 @@ class IMkvWriter {
// |position| is the location in the WebM stream where the first octet of the
// element identifier will be written.
// Note: the |MkvId| enumeration in webmids.hpp defines element values.
virtual void ElementStartNotify(uint64_t element_id, int64_t position) = 0;
virtual void ElementStartNotify(uint64 element_id, int64 position) = 0;
protected:
IMkvWriter();

View File

@ -9,6 +9,15 @@
#ifndef MKVMUXER_MKVMUXERTYPES_H_
#define MKVMUXER_MKVMUXERTYPES_H_
namespace mkvmuxer {
typedef unsigned char uint8;
typedef short int16;
typedef int int32;
typedef unsigned int uint32;
typedef long long int64;
typedef unsigned long long uint64;
} // namespace mkvmuxer
// Copied from Chromium basictypes.h
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class

View File

@ -20,7 +20,7 @@ MkvWriter::MkvWriter(FILE* fp) : file_(fp), writer_owns_file_(false) {}
MkvWriter::~MkvWriter() { Close(); }
int32_t MkvWriter::Write(const void* buffer, uint32_t length) {
int32 MkvWriter::Write(const void* buffer, uint32 length) {
if (!file_)
return -1;
@ -59,7 +59,7 @@ void MkvWriter::Close() {
file_ = NULL;
}
int64_t MkvWriter::Position() const {
int64 MkvWriter::Position() const {
if (!file_)
return 0;
@ -70,7 +70,7 @@ int64_t MkvWriter::Position() const {
#endif
}
int32_t MkvWriter::Position(int64_t position) {
int32 MkvWriter::Position(int64 position) {
if (!file_)
return -1;
@ -83,6 +83,6 @@ int32_t MkvWriter::Position(int64_t position) {
bool MkvWriter::Seekable() const { return true; }
void MkvWriter::ElementStartNotify(uint64_t, int64_t) {}
void MkvWriter::ElementStartNotify(uint64, int64) {}
} // namespace mkvmuxer

View File

@ -24,11 +24,11 @@ class MkvWriter : public IMkvWriter {
virtual ~MkvWriter();
// IMkvWriter interface
virtual int64_t Position() const;
virtual int32_t Position(int64_t position);
virtual int64 Position() const;
virtual int32 Position(int64 position);
virtual bool Seekable() const;
virtual int32_t Write(const void* buffer, uint32_t length);
virtual void ElementStartNotify(uint64_t element_id, int64_t position);
virtual int32 Write(const void* buffer, uint32 length);
virtual void ElementStartNotify(uint64 element_id, int64 position);
// Creates and opens a file for writing. |filename| is the name of the file
// to open. This function will overwrite the contents of |filename|. Returns