Skip to content

Commit

Permalink
io: default is not writable now
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Dec 6, 2015
1 parent 2b1d69a commit 18ee239
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/QtAV/MediaIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/

#ifndef QTAV_MediaIO_H
#define QTAV_MediaIO_H

Expand All @@ -27,7 +26,6 @@
#include <QtCore/QObject>

namespace QtAV {

/*!
* \brief MediaIO
* Built-in io (use MediaIO::create(name), example: MediaIO *qio = MediaIO::create("QIODevice"))
Expand All @@ -39,7 +37,6 @@ namespace QtAV {
* device - read only. example: io->device()
* protocols: "", "qrc"
*/

typedef int MediaIOId;
class MediaIOPrivate;
class Q_AV_EXPORT MediaIO : public QObject
Expand Down Expand Up @@ -87,7 +84,7 @@ class Q_AV_EXPORT MediaIO : public QObject
/// supported protocols. default is empty
virtual const QStringList& protocols() const;
virtual bool isSeekable() const = 0;
virtual bool isWritable() const = 0;
virtual bool isWritable() const { return false;}
/*!
* \brief read
* read at most maxSize bytes to data, and return the bytes were actually read
Expand All @@ -97,7 +94,11 @@ class Q_AV_EXPORT MediaIO : public QObject
* \brief write
* write at most maxSize bytes from data, and return the bytes were actually written
*/
virtual qint64 write(const char* data, qint64 maxSize) = 0;
virtual qint64 write(const char* data, qint64 maxSize) {
Q_UNUSED(data);
Q_UNUSED(maxSize);
return 0;
}
/*!
* \brief seek
* \param from SEEK_SET, SEEK_CUR and SEEK_END from stdio.h
Expand Down
3 changes: 0 additions & 3 deletions src/io/AndroidIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ class AndroidIO : public MediaIO
static QStringList p = QStringList() << QStringLiteral("content"); // "file:" is supported too but we use QFile
return p;
}

virtual bool isSeekable() const Q_DECL_OVERRIDE;
virtual bool isWritable() const Q_DECL_OVERRIDE { return false;}
virtual qint64 read(char *data, qint64 maxSize) Q_DECL_OVERRIDE;
virtual qint64 write(const char *, qint64) Q_DECL_OVERRIDE { return 0;}
virtual bool seek(qint64 offset, int from) Q_DECL_OVERRIDE;
virtual qint64 position() const Q_DECL_OVERRIDE;
/*!
Expand Down

0 comments on commit 18ee239

Please sign in to comment.