[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libbase/Makefile.am libmedia/ff...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog libbase/Makefile.am libmedia/ff... |
Date: |
Thu, 12 Jun 2008 19:49:36 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/06/12 19:49:36
Modified files:
. : ChangeLog
libbase : Makefile.am
libmedia/ffmpeg: sound_handler_sdl.h
Added files:
libbase : SimpleBuffer.h
Removed files:
libbase : Buffer.h
Log message:
* libbase/Buffer.h, SimpleBuffer.h, Makefile.am,
libmedia/ffmpeg/sound_handler_sdl.h:
Renamed Buffer to SimpleBuffer, to avoid name clash
with the one in libamf.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6914&r2=1.6915
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/Makefile.am?cvsroot=gnash&r1=1.120&r2=1.121
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/SimpleBuffer.h?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/Buffer.h?cvsroot=gnash&r1=1.7&r2=0
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/sound_handler_sdl.h?cvsroot=gnash&r1=1.14&r2=1.15
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6914
retrieving revision 1.6915
diff -u -b -r1.6914 -r1.6915
--- ChangeLog 12 Jun 2008 19:08:06 -0000 1.6914
+++ ChangeLog 12 Jun 2008 19:49:35 -0000 1.6915
@@ -1,3 +1,10 @@
+2008-06-12 Sandro Santilli <address@hidden>
+
+ * libbase/Buffer.h, SimpleBuffer.h, Makefile.am,
+ libmedia/ffmpeg/sound_handler_sdl.h:
+ Renamed Buffer to SimpleBuffer, to avoid name clash
+ with the one in libamf.
+
2008-06-12 Russ Nelson <address@hidden>
* configure.ac:
Index: libbase/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/libbase/Makefile.am,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -b -r1.120 -r1.121
--- libbase/Makefile.am 11 Jun 2008 13:58:17 -0000 1.120
+++ libbase/Makefile.am 12 Jun 2008 19:49:36 -0000 1.121
@@ -123,7 +123,7 @@
noinst_HEADERS = \
$(LIBLTDLHEAD) \
dlmalloc.h \
- Buffer.h \
+ SimpleBuffer.h \
extension.h \
GnashException.h \
gettext.h \
Index: libmedia/ffmpeg/sound_handler_sdl.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/sound_handler_sdl.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- libmedia/ffmpeg/sound_handler_sdl.h 11 Jun 2008 18:15:35 -0000 1.14
+++ libmedia/ffmpeg/sound_handler_sdl.h 12 Jun 2008 19:49:36 -0000 1.15
@@ -23,7 +23,7 @@
#include "sound_handler.h" // for inheritance
#include "AudioDecoder.h"
-#include "Buffer.h"
+#include "SimpleBuffer.h"
#include "log.h"
@@ -62,7 +62,7 @@
class sound_data
{
/// The undecoded data
- Buffer _buf;
+ SimpleBuffer _buf;
public:
@@ -151,9 +151,9 @@
/// Used to hold the info about active sounds
//
/// This class contains a pointer to the sound_data used for playing
-/// and an optional Buffer to use when decoding is needed.
+/// and an optional SimpleBuffer to use when decoding is needed.
///
-/// When the Buffer is NULL we'll play the sound_data bytes directly
+/// When the SimpleBuffer is NULL we'll play the sound_data bytes directly
/// (we assume they are decoded already)
///
class active_sound
@@ -239,7 +239,7 @@
{
if ( ! _decodedData.get() )
{
- _decodedData.reset( new Buffer );
+ _decodedData.reset( new SimpleBuffer );
}
_decodedData->append(data, size);
@@ -258,7 +258,7 @@
{
if ( ! _decodedData.get() )
{
- _decodedData.reset( new Buffer() );
+ _decodedData.reset( new SimpleBuffer() );
}
_decodedData->resize(0); // shouldn't release memory
@@ -290,7 +290,7 @@
/// If NULL, the _undecodedData will be considered
/// decoded instead
///
- std::auto_ptr<Buffer> _decodedData;
+ std::auto_ptr<SimpleBuffer> _decodedData;
};
Index: libbase/SimpleBuffer.h
===================================================================
RCS file: libbase/SimpleBuffer.h
diff -N libbase/SimpleBuffer.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libbase/SimpleBuffer.h 12 Jun 2008 19:49:36 -0000 1.1
@@ -0,0 +1,184 @@
+//
+// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+#ifndef GNASH_SIMPLEBUFFER_H
+#define GNASH_SIMPLEBUFFER_H
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+//#include "dsodefs.h" // for DSOEXPORT (not used)
+
+#include <cassert> // for assert
+#include <boost/cstdint.hpp> // for boost::uint8_t
+#include <algorithm> // for std::copy
+
+namespace gnash {
+
+/// A simple buffer of bytes
+//
+/// This class is fully inlined and just aiming to provide RIIA
+/// and unified view of memory buffers.
+/// It is a kind of a std::vector with a reduced interface
+/// in the intentions of the author.
+///
+class SimpleBuffer {
+
+public:
+
+ /// Construct a SimpleBuffer with an optional initial capacity
+ //
+ /// @param capacity
+ /// The initial buffer capacity. This is the amount of
+ /// bytes you can append to the buffer before a new reallocation
+ /// will occur.
+ ///
+ SimpleBuffer(size_t capacity=0)
+ :
+ _data(0),
+ _size(0),
+ _capacity(capacity)
+ {
+ if ( _capacity ) _data = new boost::uint8_t[_capacity];
+ }
+
+ ~SimpleBuffer()
+ {
+ delete [] _data;
+ }
+
+ /// Copy constructor
+ //
+ /// The copy ctor will set capacity to be
+ /// as small as required to hold the size of the
+ /// model buffer.
+ ///
+ SimpleBuffer(const SimpleBuffer& b)
+ :
+ _data(0),
+ _size(b._size),
+ _capacity(b._size)
+ {
+ if ( _size )
+ {
+ _data = new boost::uint8_t[_size];
+ std::copy(b._data, b._data+b._size, _data);
+ }
+ }
+
+ /// Assignment operator
+ //
+ /// The assignment op will not reset capacity
+ ///
+ SimpleBuffer& operator= (const SimpleBuffer& b)
+ {
+ if ( this != &b ) // don't waste time on self-assignment
+ {
+ resize(0); // shouldn't deallocate memory
+ append(b);
+ }
+ return *this;
+ }
+
+ /// Return true if buffer is empty
+ bool empty() const { return _size==0; }
+
+ /// Return size of the buffer
+ size_t size() const { return _size; }
+
+ /// Return capacity of the buffer
+ size_t capacity() const { return _capacity; }
+
+ /// Get a pointer to start of data. May be NULL if size==0.
+ boost::uint8_t* data() { return _data; }
+
+ /// Get a pointer to start of data. May be NULL if size==0.
+ const boost::uint8_t* data() const { return _data; }
+
+ /// Resize the buffer
+ void resize(size_t newSize)
+ {
+ reserve(newSize); // will set capacity
+ _size = newSize;
+ }
+
+ /// Ensure at least 'newCapacity' bytes are allocated for this buffer
+ void reserve(size_t newCapacity)
+ {
+ if ( _capacity >= newCapacity ) return;
+
+ // TODO: use smalles power of 2 bigger then newCapacity
+ _capacity = std::max(newCapacity, _capacity*2);
+
+ boost::uint8_t* tmp = _data;
+ _data = new boost::uint8_t[_capacity];
+ if ( tmp )
+ {
+ if ( _size ) std::copy(tmp, tmp+_size, _data);
+ delete [] tmp;
+ }
+ }
+
+ /// Append data to the buffer
+ //
+ /// The buffer will be appropriately resized to have space for
+ /// the incoming data. The data will be copied.
+ ///
+ /// @param newData
+ /// Data to append. Will be copied.
+ ///
+ /// @param size
+ /// Size of data to append
+ ///
+ void append(const boost::uint8_t* newData, size_t size)
+ {
+ size_t curSize = _size;
+ resize(curSize+size);
+ std::copy(newData, newData+size, _data+curSize);
+ assert(_size == curSize+size);
+ }
+
+ /// Append data to the buffer
+ //
+ /// The buffer will be appropriately resized to have space for
+ /// the incoming data. The data will be copied.
+ ///
+ /// @param newData
+ /// SimpleBuffer containing data to append
+ ///
+ void append(const SimpleBuffer& buf)
+ {
+ size_t incomingDataSize = buf.size();
+ const boost::uint8_t* incomingData = buf.data();
+ append(incomingData, incomingDataSize);
+ }
+
+private:
+
+ boost::uint8_t* _data;
+
+ size_t _size;
+ size_t _capacity;
+
+};
+
+
+} // namespace gnash
+
+#endif // GNASH_SIMPLEBUFFER_H
Index: libbase/Buffer.h
===================================================================
RCS file: libbase/Buffer.h
diff -N libbase/Buffer.h
--- libbase/Buffer.h 11 Jun 2008 18:28:15 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,184 +0,0 @@
-//
-// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-#ifndef GNASH_BUFFER_H
-#define GNASH_BUFFER_H
-
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
-//#include "dsodefs.h" // for DSOEXPORT (not used)
-
-#include <cassert> // for assert
-#include <boost/cstdint.hpp> // for boost::uint8_t
-#include <algorithm> // for std::copy
-
-namespace gnash {
-
-/// A simple buffer of bytes
-//
-/// This class is fully inlined and just aiming to provide RIIA
-/// and unified view of memory buffers.
-/// It is a kind of a std::vector with a reduced interface
-/// in the intentions of the author.
-///
-class Buffer {
-
-public:
-
- /// Construct a Buffer with an optional initial capacity
- //
- /// @param capacity
- /// The initial buffer capacity. This is the amount of
- /// bytes you can append to the buffer before a new reallocation
- /// will occur.
- ///
- Buffer(size_t capacity=0)
- :
- _data(0),
- _size(0),
- _capacity(capacity)
- {
- if ( _capacity ) _data = new boost::uint8_t[_capacity];
- }
-
- ~Buffer()
- {
- delete [] _data;
- }
-
- /// Copy constructor
- //
- /// The copy ctor will set capacity to be
- /// as small as required to hold the size of the
- /// model buffer.
- ///
- Buffer(const Buffer& b)
- :
- _data(0),
- _size(b._size),
- _capacity(b._size)
- {
- if ( _size )
- {
- _data = new boost::uint8_t[_size];
- std::copy(b._data, b._data+b._size, _data);
- }
- }
-
- /// Assignment operator
- //
- /// The assignment op will not reset capacity
- ///
- Buffer& operator= (const Buffer& b)
- {
- if ( this != &b ) // don't waste time on self-assignment
- {
- resize(0); // shouldn't deallocate memory
- append(b);
- }
- return *this;
- }
-
- /// Return true if buffer is empty
- bool empty() const { return _size==0; }
-
- /// Return size of the buffer
- size_t size() const { return _size; }
-
- /// Return capacity of the buffer
- size_t capacity() const { return _capacity; }
-
- /// Get a pointer to start of data. May be NULL if size==0.
- boost::uint8_t* data() { return _data; }
-
- /// Get a pointer to start of data. May be NULL if size==0.
- const boost::uint8_t* data() const { return _data; }
-
- /// Resize the buffer
- void resize(size_t newSize)
- {
- reserve(newSize); // will set capacity
- _size = newSize;
- }
-
- /// Ensure at least 'newCapacity' bytes are allocated for this buffer
- void reserve(size_t newCapacity)
- {
- if ( _capacity >= newCapacity ) return;
-
- // TODO: use smalles power of 2 bigger then newCapacity
- _capacity = std::max(newCapacity, _capacity*2);
-
- boost::uint8_t* tmp = _data;
- _data = new boost::uint8_t[_capacity];
- if ( tmp )
- {
- if ( _size ) std::copy(tmp, tmp+_size, _data);
- delete [] tmp;
- }
- }
-
- /// Append data to the buffer
- //
- /// The buffer will be appropriately resized to have space for
- /// the incoming data. The data will be copied.
- ///
- /// @param newData
- /// Data to append. Will be copied.
- ///
- /// @param size
- /// Size of data to append
- ///
- void append(const boost::uint8_t* newData, size_t size)
- {
- size_t curSize = _size;
- resize(curSize+size);
- std::copy(newData, newData+size, _data+curSize);
- assert(_size == curSize+size);
- }
-
- /// Append data to the buffer
- //
- /// The buffer will be appropriately resized to have space for
- /// the incoming data. The data will be copied.
- ///
- /// @param newData
- /// Buffer containing data to append
- ///
- void append(const Buffer& buf)
- {
- size_t incomingDataSize = buf.size();
- const boost::uint8_t* incomingData = buf.data();
- append(incomingData, incomingDataSize);
- }
-
-private:
-
- boost::uint8_t* _data;
-
- size_t _size;
- size_t _capacity;
-
-};
-
-
-} // namespace gnash
-
-#endif // GNASH_BUFFER_H
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog libbase/Makefile.am libmedia/ff...,
Sandro Santilli <=