winlin

rename SrsMessage to SrsCommonMessage

... ... @@ -172,28 +172,28 @@ int SrsClient::streaming_play(SrsSource* source)
// read from client.
if (ready) {
SrsMessage* msg = NULL;
SrsCommonMessage* msg = NULL;
if ((ret = rtmp->recv_message(&msg)) != ERROR_SUCCESS) {
srs_error("recv client control message failed. ret=%d", ret);
return ret;
}
SrsAutoFree(SrsMessage, msg, false);
SrsAutoFree(SrsCommonMessage, msg, false);
// TODO: process it.
}
// get messages from consumer.
SrsMessage** msgs = NULL;
SrsCommonMessage** msgs = NULL;
int count = 0;
if ((ret = consumer->get_packets(0, msgs, count)) != ERROR_SUCCESS) {
srs_error("get messages from consumer failed. ret=%d", ret);
return ret;
}
SrsAutoFree(SrsMessage*, msgs, true);
SrsAutoFree(SrsCommonMessage*, msgs, true);
// sendout messages
for (int i = 0; i < count; i++) {
SrsMessage* msg = msgs[i];
SrsCommonMessage* msg = msgs[i];
if ((ret = rtmp->send_message(msg)) != ERROR_SUCCESS) {
srs_error("send message to client failed. ret=%d", ret);
return ret;
... ... @@ -209,13 +209,13 @@ int SrsClient::streaming_publish(SrsSource* source)
int ret = ERROR_SUCCESS;
while (true) {
SrsMessage* msg = NULL;
SrsCommonMessage* msg = NULL;
if ((ret = rtmp->recv_message(&msg)) != ERROR_SUCCESS) {
srs_error("recv identify client message failed. ret=%d", ret);
return ret;
}
SrsAutoFree(SrsMessage, msg, false);
SrsAutoFree(SrsCommonMessage, msg, false);
// process audio packet
if (msg->header.is_audio() && ((ret = source->on_audio(msg)) != ERROR_SUCCESS)) {
... ...
... ... @@ -279,14 +279,14 @@ int SrsProtocol::can_read(int timeout_ms, bool& ready)
return skt->can_read(timeout_ms, ready);
}
int SrsProtocol::recv_message(SrsMessage** pmsg)
int SrsProtocol::recv_message(SrsCommonMessage** pmsg)
{
*pmsg = NULL;
int ret = ERROR_SUCCESS;
while (true) {
SrsMessage* msg = NULL;
SrsCommonMessage* msg = NULL;
if ((ret = recv_interlaced_message(&msg)) != ERROR_SUCCESS) {
srs_error("recv interlaced message failed. ret=%d", ret);
... ... @@ -440,7 +440,7 @@ int SrsProtocol::send_message(SrsOutputableMessage* msg)
return ret;
}
int SrsProtocol::on_recv_message(SrsMessage* msg)
int SrsProtocol::on_recv_message(SrsCommonMessage* msg)
{
int ret = ERROR_SUCCESS;
... ... @@ -483,7 +483,7 @@ int SrsProtocol::on_send_message(SrsOutputableMessage* msg)
{
int ret = ERROR_SUCCESS;
SrsMessage* common_msg = dynamic_cast<SrsMessage*>(msg);
SrsCommonMessage* common_msg = dynamic_cast<SrsCommonMessage*>(msg);
if (!msg) {
srs_verbose("ignore the shared ptr message.");
return ret;
... ... @@ -506,7 +506,7 @@ int SrsProtocol::on_send_message(SrsOutputableMessage* msg)
return ret;
}
int SrsProtocol::recv_interlaced_message(SrsMessage** pmsg)
int SrsProtocol::recv_interlaced_message(SrsCommonMessage** pmsg)
{
int ret = ERROR_SUCCESS;
... ... @@ -545,7 +545,7 @@ int SrsProtocol::recv_interlaced_message(SrsMessage** pmsg)
chunk->header.payload_length, chunk->header.timestamp, chunk->header.stream_id);
// read msg payload from chunk stream.
SrsMessage* msg = NULL;
SrsCommonMessage* msg = NULL;
int payload_size = 0;
if ((ret = read_message_payload(chunk, bh_size, mh_size, payload_size, &msg)) != ERROR_SUCCESS) {
srs_error("read message payload failed. ret=%d", ret);
... ... @@ -668,7 +668,7 @@ int SrsProtocol::read_message_header(SrsChunkStream* chunk, char fmt, int bh_siz
// create msg when new chunk stream start
if (!chunk->msg) {
chunk->msg = new SrsMessage();
chunk->msg = new SrsCommonMessage();
srs_verbose("create message for new chunk, fmt=%d, cid=%d", fmt, chunk->cid);
}
... ... @@ -794,7 +794,7 @@ int SrsProtocol::read_message_header(SrsChunkStream* chunk, char fmt, int bh_siz
return ret;
}
int SrsProtocol::read_message_payload(SrsChunkStream* chunk, int bh_size, int mh_size, int& payload_size, SrsMessage** pmsg)
int SrsProtocol::read_message_payload(SrsChunkStream* chunk, int bh_size, int mh_size, int& payload_size, SrsCommonMessage** pmsg)
{
int ret = ERROR_SUCCESS;
... ... @@ -943,19 +943,19 @@ void SrsOutputableMessage::free_payload()
srs_freepa(payload);
}
SrsMessage::SrsMessage()
SrsCommonMessage::SrsCommonMessage()
{
stream = NULL;
packet = NULL;
}
SrsMessage::~SrsMessage()
SrsCommonMessage::~SrsCommonMessage()
{
srs_freep(packet);
srs_freep(stream);
}
int SrsMessage::decode_packet()
int SrsCommonMessage::decode_packet()
{
int ret = ERROR_SUCCESS;
... ... @@ -1061,7 +1061,7 @@ int SrsMessage::decode_packet()
return ret;
}
SrsPacket* SrsMessage::get_packet()
SrsPacket* SrsCommonMessage::get_packet()
{
if (!packet) {
srs_error("the payload is raw/undecoded, invoke decode_packet to decode it.");
... ... @@ -1071,7 +1071,7 @@ SrsPacket* SrsMessage::get_packet()
return packet;
}
int SrsMessage::get_perfer_cid()
int SrsCommonMessage::get_perfer_cid()
{
if (!packet) {
return RTMP_CID_ProtocolControl;
... ... @@ -1086,7 +1086,7 @@ int SrsMessage::get_perfer_cid()
return packet->get_perfer_cid();
}
void SrsMessage::set_packet(SrsPacket* pkt, int stream_id)
void SrsCommonMessage::set_packet(SrsPacket* pkt, int stream_id)
{
srs_freep(packet);
... ... @@ -1097,7 +1097,7 @@ void SrsMessage::set_packet(SrsPacket* pkt, int stream_id)
header.stream_id = stream_id;
}
int SrsMessage::encode_packet()
int SrsCommonMessage::encode_packet()
{
int ret = ERROR_SUCCESS;
... ...
... ... @@ -42,7 +42,7 @@ class SrsSocket;
class SrsBuffer;
class SrsPacket;
class SrsStream;
class SrsMessage;
class SrsCommonMessage;
class SrsChunkStream;
class SrsAmf0Object;
class SrsAmf0Null;
... ... @@ -105,7 +105,7 @@ public:
* @pmsg, user must free it. NULL if not success.
* @remark, only when success, user can use and must free the pmsg.
*/
virtual int recv_message(SrsMessage** pmsg);
virtual int recv_message(SrsCommonMessage** pmsg);
/**
* send out message with encoded payload to peer.
* use the message encode method to encode to payload,
... ... @@ -117,7 +117,7 @@ private:
/**
* when recv message, update the context.
*/
virtual int on_recv_message(SrsMessage* msg);
virtual int on_recv_message(SrsCommonMessage* msg);
/**
* when message sentout, update the context.
*/
... ... @@ -128,7 +128,7 @@ private:
* return success and pmsg set to NULL if no entire message got,
* return success and pmsg set to entire message if got one.
*/
virtual int recv_interlaced_message(SrsMessage** pmsg);
virtual int recv_interlaced_message(SrsCommonMessage** pmsg);
/**
* read the chunk basic header(fmt, cid) from chunk stream.
* user can discovery a SrsChunkStream by cid.
... ... @@ -146,7 +146,7 @@ private:
* if got entire message, set the pmsg.
* @payload_size read size in this roundtrip, generally a chunk size or left message size.
*/
virtual int read_message_payload(SrsChunkStream* chunk, int bh_size, int mh_size, int& payload_size, SrsMessage** pmsg);
virtual int read_message_payload(SrsChunkStream* chunk, int bh_size, int mh_size, int& payload_size, SrsCommonMessage** pmsg);
};
/**
... ... @@ -222,7 +222,7 @@ public:
/**
* partially read message.
*/
SrsMessage* msg;
SrsCommonMessage* msg;
/**
* decoded msg count, to identify whether the chunk stream is fresh.
*/
... ... @@ -274,7 +274,7 @@ public:
* common RTMP message defines in rtmp.part2.Message-Formats.pdf.
* cannbe parse and decode.
*/
class SrsMessage : public SrsOutputableMessage
class SrsCommonMessage : public SrsOutputableMessage
{
private:
typedef SrsOutputableMessage super;
... ... @@ -283,8 +283,8 @@ private:
SrsStream* stream;
SrsPacket* packet;
public:
SrsMessage();
virtual ~SrsMessage();
SrsCommonMessage();
virtual ~SrsCommonMessage();
/**
* decode functions.
*/
... ... @@ -959,7 +959,7 @@ protected:
* @remark, only when success, user can use and must free the pmsg/ppacket.
*/
template<class T>
int srs_rtmp_expect_message(SrsProtocol* protocol, SrsMessage** pmsg, T** ppacket)
int srs_rtmp_expect_message(SrsProtocol* protocol, SrsCommonMessage** pmsg, T** ppacket)
{
*pmsg = NULL;
*ppacket = NULL;
... ... @@ -967,7 +967,7 @@ int srs_rtmp_expect_message(SrsProtocol* protocol, SrsMessage** pmsg, T** ppacke
int ret = ERROR_SUCCESS;
while (true) {
SrsMessage* msg = NULL;
SrsCommonMessage* msg = NULL;
if ((ret = protocol->recv_message(&msg)) != ERROR_SUCCESS) {
srs_error("recv message failed. ret=%d", ret);
return ret;
... ...
... ... @@ -142,7 +142,7 @@ SrsRtmp::~SrsRtmp()
srs_freep(protocol);
}
int SrsRtmp::recv_message(SrsMessage** pmsg)
int SrsRtmp::recv_message(SrsCommonMessage** pmsg)
{
return protocol->recv_message(pmsg);
}
... ... @@ -152,7 +152,7 @@ int SrsRtmp::can_read(int timeout_ms, bool& ready)
return protocol->can_read(timeout_ms, ready);
}
int SrsRtmp::send_message(SrsMessage* msg)
int SrsRtmp::send_message(SrsCommonMessage* msg)
{
return protocol->send_message(msg);
}
... ... @@ -207,13 +207,13 @@ int SrsRtmp::connect_app(SrsRequest* req)
{
int ret = ERROR_SUCCESS;
SrsMessage* msg = NULL;
SrsCommonMessage* msg = NULL;
SrsConnectAppPacket* pkt = NULL;
if ((ret = srs_rtmp_expect_message<SrsConnectAppPacket>(protocol, &msg, &pkt)) != ERROR_SUCCESS) {
srs_error("expect connect app message failed. ret=%d", ret);
return ret;
}
SrsAutoFree(SrsMessage, msg, false);
SrsAutoFree(SrsCommonMessage, msg, false);
srs_info("get connect app message");
SrsAmf0Any* prop = NULL;
... ... @@ -246,7 +246,7 @@ int SrsRtmp::set_window_ack_size(int ack_size)
{
int ret = ERROR_SUCCESS;
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsSetWindowAckSizePacket* pkt = new SrsSetWindowAckSizePacket();
pkt->ackowledgement_window_size = ack_size;
... ... @@ -265,7 +265,7 @@ int SrsRtmp::set_peer_bandwidth(int bandwidth, int type)
{
int ret = ERROR_SUCCESS;
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsSetPeerBandwidthPacket* pkt = new SrsSetPeerBandwidthPacket();
pkt->bandwidth = bandwidth;
... ... @@ -286,7 +286,7 @@ int SrsRtmp::response_connect_app(SrsRequest* req)
{
int ret = ERROR_SUCCESS;
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsConnectAppResPacket* pkt = new SrsConnectAppResPacket();
pkt->props->set("fmsVer", new SrsAmf0String("FMS/"RTMP_SIG_FMS_VER));
... ... @@ -320,7 +320,7 @@ int SrsRtmp::on_bw_done()
{
int ret = ERROR_SUCCESS;
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsOnBWDonePacket* pkt = new SrsOnBWDonePacket();
msg->set_packet(pkt, 0);
... ... @@ -340,13 +340,13 @@ int SrsRtmp::identify_client(int stream_id, SrsClientType& type, std::string& st
int ret = ERROR_SUCCESS;
while (true) {
SrsMessage* msg = NULL;
SrsCommonMessage* msg = NULL;
if ((ret = protocol->recv_message(&msg)) != ERROR_SUCCESS) {
srs_error("recv identify client message failed. ret=%d", ret);
return ret;
}
SrsAutoFree(SrsMessage, msg, false);
SrsAutoFree(SrsCommonMessage, msg, false);
if (!msg->header.is_amf0_command() && !msg->header.is_amf3_command()) {
srs_trace("identify ignore messages except "
... ... @@ -381,7 +381,7 @@ int SrsRtmp::set_chunk_size(int chunk_size)
{
int ret = ERROR_SUCCESS;
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsSetChunkSizePacket* pkt = new SrsSetChunkSizePacket();
pkt->chunk_size = chunk_size;
... ... @@ -402,7 +402,7 @@ int SrsRtmp::start_play(int stream_id)
// StreamBegin
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsPCUC4BytesPacket* pkt = new SrsPCUC4BytesPacket();
pkt->event_type = SrcPCUCStreamBegin;
... ... @@ -418,7 +418,7 @@ int SrsRtmp::start_play(int stream_id)
// onStatus(NetStream.Play.Reset)
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsOnStatusCallPacket* pkt = new SrsOnStatusCallPacket();
pkt->data->set(StatusLevel, new SrsAmf0String(StatusLevelStatus));
... ... @@ -438,7 +438,7 @@ int SrsRtmp::start_play(int stream_id)
// onStatus(NetStream.Play.Start)
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsOnStatusCallPacket* pkt = new SrsOnStatusCallPacket();
pkt->data->set(StatusLevel, new SrsAmf0String(StatusLevelStatus));
... ... @@ -458,7 +458,7 @@ int SrsRtmp::start_play(int stream_id)
// |RtmpSampleAccess(false, false)
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsSampleAccessPacket* pkt = new SrsSampleAccessPacket();
msg->set_packet(pkt, stream_id);
... ... @@ -472,7 +472,7 @@ int SrsRtmp::start_play(int stream_id)
// onStatus(NetStream.Data.Start)
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsOnStatusDataPacket* pkt = new SrsOnStatusDataPacket();
pkt->data->set(StatusCode, new SrsAmf0String(StatusCodeDataStart));
... ... @@ -498,7 +498,7 @@ int SrsRtmp::start_publish(int stream_id)
// FCPublish
double fc_publish_tid = 0;
if (true) {
SrsMessage* msg = NULL;
SrsCommonMessage* msg = NULL;
SrsFMLEStartPacket* pkt = NULL;
if ((ret = srs_rtmp_expect_message<SrsFMLEStartPacket>(protocol, &msg, &pkt)) != ERROR_SUCCESS) {
srs_error("recv FCPublish message failed. ret=%d", ret);
... ... @@ -506,12 +506,12 @@ int SrsRtmp::start_publish(int stream_id)
}
srs_info("recv FCPublish request message success.");
SrsAutoFree(SrsMessage, msg, false);
SrsAutoFree(SrsCommonMessage, msg, false);
fc_publish_tid = pkt->transaction_id;
}
// FCPublish response
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsFMLEStartResPacket* pkt = new SrsFMLEStartResPacket(fc_publish_tid);
msg->set_packet(pkt, 0);
... ... @@ -526,7 +526,7 @@ int SrsRtmp::start_publish(int stream_id)
// createStream
double create_stream_tid = 0;
if (true) {
SrsMessage* msg = NULL;
SrsCommonMessage* msg = NULL;
SrsCreateStreamPacket* pkt = NULL;
if ((ret = srs_rtmp_expect_message<SrsCreateStreamPacket>(protocol, &msg, &pkt)) != ERROR_SUCCESS) {
srs_error("recv createStream message failed. ret=%d", ret);
... ... @@ -534,12 +534,12 @@ int SrsRtmp::start_publish(int stream_id)
}
srs_info("recv createStream request message success.");
SrsAutoFree(SrsMessage, msg, false);
SrsAutoFree(SrsCommonMessage, msg, false);
create_stream_tid = pkt->transaction_id;
}
// createStream response
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsCreateStreamResPacket* pkt = new SrsCreateStreamResPacket(create_stream_tid, stream_id);
msg->set_packet(pkt, 0);
... ... @@ -553,7 +553,7 @@ int SrsRtmp::start_publish(int stream_id)
// publish
if (true) {
SrsMessage* msg = NULL;
SrsCommonMessage* msg = NULL;
SrsPublishPacket* pkt = NULL;
if ((ret = srs_rtmp_expect_message<SrsPublishPacket>(protocol, &msg, &pkt)) != ERROR_SUCCESS) {
srs_error("recv publish message failed. ret=%d", ret);
... ... @@ -561,11 +561,11 @@ int SrsRtmp::start_publish(int stream_id)
}
srs_info("recv publish request message success.");
SrsAutoFree(SrsMessage, msg, false);
SrsAutoFree(SrsCommonMessage, msg, false);
}
// publish response onFCPublish(NetStream.Publish.Start)
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsOnStatusCallPacket* pkt = new SrsOnStatusCallPacket();
pkt->command_name = RTMP_AMF0_COMMAND_ON_FC_PUBLISH;
... ... @@ -582,7 +582,7 @@ int SrsRtmp::start_publish(int stream_id)
}
// publish response onStatus(NetStream.Publish.Start)
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsOnStatusCallPacket* pkt = new SrsOnStatusCallPacket();
pkt->data->set(StatusLevel, new SrsAmf0String(StatusLevelStatus));
... ... @@ -608,7 +608,7 @@ int SrsRtmp::fmle_unpublish(int stream_id, double unpublish_tid)
// publish response onFCUnpublish(NetStream.unpublish.Success)
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsOnStatusCallPacket* pkt = new SrsOnStatusCallPacket();
pkt->command_name = RTMP_AMF0_COMMAND_ON_FC_UNPUBLISH;
... ... @@ -625,7 +625,7 @@ int SrsRtmp::fmle_unpublish(int stream_id, double unpublish_tid)
}
// FCUnpublish response
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsFMLEStartResPacket* pkt = new SrsFMLEStartResPacket(unpublish_tid);
msg->set_packet(pkt, stream_id);
... ... @@ -638,7 +638,7 @@ int SrsRtmp::fmle_unpublish(int stream_id, double unpublish_tid)
}
// publish response onStatus(NetStream.Unpublish.Success)
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsOnStatusCallPacket* pkt = new SrsOnStatusCallPacket();
pkt->data->set(StatusLevel, new SrsAmf0String(StatusLevelStatus));
... ... @@ -665,7 +665,7 @@ int SrsRtmp::identify_create_stream_client(SrsCreateStreamPacket* req, int strea
int ret = ERROR_SUCCESS;
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsCreateStreamResPacket* pkt = new SrsCreateStreamResPacket(req->transaction_id, stream_id);
msg->set_packet(pkt, 0);
... ... @@ -678,13 +678,13 @@ int SrsRtmp::identify_create_stream_client(SrsCreateStreamPacket* req, int strea
}
while (true) {
SrsMessage* msg = NULL;
SrsCommonMessage* msg = NULL;
if ((ret = protocol->recv_message(&msg)) != ERROR_SUCCESS) {
srs_error("recv identify client message failed. ret=%d", ret);
return ret;
}
SrsAutoFree(SrsMessage, msg, false);
SrsAutoFree(SrsCommonMessage, msg, false);
if (!msg->header.is_amf0_command() && !msg->header.is_amf3_command()) {
srs_trace("identify ignore messages except "
... ... @@ -721,7 +721,7 @@ int SrsRtmp::identify_fmle_publish_client(SrsFMLEStartPacket* req, SrsClientType
// releaseStream response
if (true) {
SrsMessage* msg = new SrsMessage();
SrsCommonMessage* msg = new SrsCommonMessage();
SrsFMLEStartResPacket* pkt = new SrsFMLEStartResPacket(req->transaction_id);
msg->set_packet(pkt, 0);
... ...
... ... @@ -35,7 +35,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <st.h>
class SrsProtocol;
class SrsMessage;
class SrsCommonMessage;
class SrsCreateStreamPacket;
class SrsFMLEStartPacket;
... ... @@ -100,9 +100,9 @@ public:
SrsRtmp(st_netfd_t client_stfd);
virtual ~SrsRtmp();
public:
virtual int recv_message(SrsMessage** pmsg);
virtual int recv_message(SrsCommonMessage** pmsg);
virtual int can_read(int timeout_ms, bool& ready);
virtual int send_message(SrsMessage* msg);
virtual int send_message(SrsCommonMessage* msg);
public:
virtual int handshake();
virtual int connect_app(SrsRequest* req);
... ...
... ... @@ -47,7 +47,7 @@ SrsConsumer::~SrsConsumer()
{
}
int SrsConsumer::get_packets(int max_count, SrsMessage**& msgs, int& count)
int SrsConsumer::get_packets(int max_count, SrsCommonMessage**& msgs, int& count)
{
msgs = NULL;
count = 0;
... ... @@ -65,7 +65,7 @@ SrsSource::~SrsSource()
{
}
int SrsSource::on_meta_data(SrsMessage* msg, SrsOnMetaDataPacket* metadata)
int SrsSource::on_meta_data(SrsCommonMessage* msg, SrsOnMetaDataPacket* metadata)
{
int ret = ERROR_SUCCESS;
... ... @@ -75,13 +75,13 @@ int SrsSource::on_meta_data(SrsMessage* msg, SrsOnMetaDataPacket* metadata)
return ret;
}
int SrsSource::on_audio(SrsMessage* audio)
int SrsSource::on_audio(SrsCommonMessage* audio)
{
int ret = ERROR_SUCCESS;
return ret;
}
int SrsSource::on_video(SrsMessage* audio)
int SrsSource::on_video(SrsCommonMessage* audio)
{
int ret = ERROR_SUCCESS;
return ret;
... ...
... ... @@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <map>
#include <string>
class SrsMessage;
class SrsCommonMessage;
class SrsOnMetaDataPacket;
/**
... ... @@ -51,7 +51,7 @@ public:
* @count the count in array.
* @max_count the max count to dequeue, 0 to dequeue all.
*/
virtual int get_packets(int max_count, SrsMessage**& msgs, int& count);
virtual int get_packets(int max_count, SrsCommonMessage**& msgs, int& count);
};
/**
... ... @@ -75,9 +75,9 @@ public:
SrsSource(std::string _stream_url);
virtual ~SrsSource();
public:
virtual int on_meta_data(SrsMessage* msg, SrsOnMetaDataPacket* metadata);
virtual int on_audio(SrsMessage* audio);
virtual int on_video(SrsMessage* video);
virtual int on_meta_data(SrsCommonMessage* msg, SrsOnMetaDataPacket* metadata);
virtual int on_audio(SrsCommonMessage* audio);
virtual int on_video(SrsCommonMessage* video);
public:
virtual SrsConsumer* create_consumer();
};
... ...