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.
51 lines
989 B
C
51 lines
989 B
C
3 months ago
|
//
|
||
|
// Created by Matthew on 2025/3/11.
|
||
|
//
|
||
|
|
||
|
#ifndef MICROPHOTO_STREAMING_H
|
||
|
#define MICROPHOTO_STREAMING_H
|
||
|
|
||
|
#include <string>
|
||
|
#include <memory>
|
||
|
|
||
|
#include <android/multinetwork.h>
|
||
|
|
||
|
extern "C" {
|
||
|
#include <libavcodec/avcodec.h>
|
||
|
#include <libavformat/avformat.h>
|
||
|
#include <libavutil/avutil.h>
|
||
|
#include <libswscale/swscale.h>
|
||
|
}
|
||
|
|
||
|
class Streaming
|
||
|
{
|
||
|
public:
|
||
|
virtual ~Streaming() {}
|
||
|
virtual void start() {}
|
||
|
virtual void stop() {}
|
||
|
};
|
||
|
#if 0
|
||
|
class StreamForwarder : public Streaming
|
||
|
{
|
||
|
private:
|
||
|
AVFormatContext* inputCtx = nullptr;
|
||
|
AVFormatContext* outputCtx = nullptr;
|
||
|
bool isRunning = false;
|
||
|
|
||
|
public:
|
||
|
StreamForwarder() = default;
|
||
|
virtual ~StreamForwarder();
|
||
|
|
||
|
bool initialize(const std::string& inputUrl, const std::string& outputUrl);
|
||
|
virtual void start();
|
||
|
virtual void stop();
|
||
|
|
||
|
private:
|
||
|
bool openInput(const std::string& inputUrl);
|
||
|
bool openOutput(const std::string& outputUrl);
|
||
|
void forwardPackets();
|
||
|
};
|
||
|
#endif
|
||
|
|
||
|
#endif //MICROPHOTO_STREAMING_H
|