You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.4 KiB
C++
76 lines
2.4 KiB
C++
/*
|
|
* MPD DVD-Audio Decoder plugin
|
|
* Copyright (c) 2014-2025 Maxim V.Anisiutkin <maxim.anisiutkin@gmail.com>
|
|
*
|
|
* DVD-Audio Decoder is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* DVD-Audio Decoder 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
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "config.h"
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
#include <string>
|
|
#include "input/InputStream.hxx"
|
|
#include "Log.hxx"
|
|
|
|
enum class media_type_t {UNK_TYPE = 0, IFO_TYPE = 1, ISO_TYPE = 2, MLP_TYPE = 3, AOB_TYPE = 4};
|
|
|
|
class dvda_media_t {
|
|
public:
|
|
dvda_media_t() {}
|
|
virtual ~dvda_media_t() {}
|
|
virtual const char* get_name() = 0;
|
|
virtual int64_t get_position() = 0;
|
|
virtual int64_t get_size() = 0;
|
|
virtual bool open(const char* path) = 0;
|
|
virtual bool close() = 0;
|
|
virtual bool seek(int64_t position) = 0;
|
|
virtual size_t read(void* data, size_t size) = 0;
|
|
virtual int64_t skip(int64_t bytes) = 0;
|
|
};
|
|
|
|
class dvda_media_file_t : public dvda_media_t {
|
|
std::string fname;
|
|
int fd;
|
|
public:
|
|
dvda_media_file_t();
|
|
~dvda_media_file_t();
|
|
const char* get_name() override;
|
|
int64_t get_position() override;
|
|
int64_t get_size() override;
|
|
bool open(const char* path) override;
|
|
bool close() override;
|
|
bool seek(int64_t position) override;
|
|
size_t read(void* data, size_t size) override;
|
|
int64_t skip(int64_t bytes) override;
|
|
};
|
|
|
|
class dvda_media_stream_t : public dvda_media_t {
|
|
Mutex mutex;
|
|
InputStreamPtr is;
|
|
public:
|
|
dvda_media_stream_t();
|
|
~dvda_media_stream_t();
|
|
const char* get_name() override;
|
|
int64_t get_position() override;
|
|
int64_t get_size() override;
|
|
bool open(const char* path) override;
|
|
bool close() override;
|
|
bool seek(int64_t position) override;
|
|
size_t read(void* data, size_t size) override;
|
|
int64_t skip(int64_t bytes) override;
|
|
};
|