MediaPlayer.h 1.1 KB
Newer Older
xiongziliang committed
1
/*
xiongziliang committed
2
 * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
xiongziliang committed
3 4 5
 *
 * This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
 *
xiongziliang committed
6 7 8
 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
xzl committed
9 10 11 12 13
 */

#ifndef SRC_PLAYER_MEDIAPLAYER_H_
#define SRC_PLAYER_MEDIAPLAYER_H_

xiongzilaing committed
14 15
#include <memory>
#include <string>
xzl committed
16
#include "PlayerBase.h"
xiongziliang committed
17 18
#include "Rtsp/RtspPlayer.h"
#include "Rtmp/RtmpPlayer.h"
xiongziliang committed
19
#include "Thread/TaskExecutor.h"
xiongziliang committed
20
using namespace toolkit;
xzl committed
21

xiongziliang committed
22
namespace mediakit {
xzl committed
23 24 25

class MediaPlayer : public PlayerImp<PlayerBase,PlayerBase> {
public:
26
    typedef std::shared_ptr<MediaPlayer> Ptr;
xzl committed
27

28 29 30 31 32 33
    MediaPlayer(const EventPoller::Ptr &poller = nullptr);
    virtual ~MediaPlayer();
    void play(const string &strUrl) override;
    void pause(bool bPause) override;
    void teardown() override;
    EventPoller::Ptr getPoller();
34
private:
35
    EventPoller::Ptr _poller;
xzl committed
36 37
};

xiongziliang committed
38
} /* namespace mediakit */
xzl committed
39 40

#endif /* SRC_PLAYER_MEDIAPLAYER_H_ */