Skip to content

Commit

Permalink
Changed the path from RTMP provider to common module
Browse files Browse the repository at this point in the history
  • Loading branch information
Keukhan committed Dec 19, 2024
1 parent 7aae7c1 commit 42a0504
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 10 deletions.
14 changes: 14 additions & 0 deletions src/projects/modules/rtmp/AMS.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
LOCAL_PATH := $(call get_local_path)
include $(DEFAULT_VARIABLES)

LOCAL_TARGET := rtmp_module

LOCAL_SOURCE_FILES := $(LOCAL_SOURCE_FILES) \
$(call get_sub_source_list,amf0) \
$(call get_sub_source_list,chunk) \

LOCAL_HEADER_FILES := $(LOCAL_HEADER_FILES) \
$(call get_sub_header_list,amf0) \
$(call get_sub_header_list,opus) \

include $(BUILD_STATIC_LIBRARY)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include <string.h>

#include "../rtmp_provider_private.h"
#include "../rtmp_private.h"
#include "./amf_object_array.h"
#include "./amf_strict_array.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class AmfProperty : public AmfPropertyBase

protected:
double _number = 0.0;
bool _boolean = true;
bool _boolean = false;
ov::String _string;
AmfObject *_object = nullptr;
AmfEcmaArray *_ecma_array = nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//==============================================================================
#include "rtmp_chunk_parser.h"

#include "../rtmp_provider_private.h"
#include "../rtmp_private.h"

RtmpChunkParser::RtmpChunkParser(int chunk_size)
: _vhost_app_name(info::VHostAppName::InvalidVHostAppName())
Expand Down
11 changes: 11 additions & 0 deletions src/projects/modules/rtmp/rtmp_private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//==============================================================================
//
// OvenMediaEngine
//
// Created by Hyunjun Jang
// Copyright (c) 2019 AirenSoft. All rights reserved.
//
//==============================================================================
#pragma once

#define OV_LOG_TAG "RTMPProvider"
7 changes: 4 additions & 3 deletions src/projects/providers/rtmp/AMS.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ LOCAL_STATIC_LIBRARIES := \
application \
ovlibrary \
flv_container \
provider
provider \
rtmp_module

LOCAL_PREBUILT_LIBRARIES := \

Expand All @@ -16,8 +17,8 @@ LOCAL_LDFLAGS := \

LOCAL_TARGET := rtmp_provider

LOCAL_SOURCE_FILES := $(LOCAL_SOURCE_FILES) $(call get_sub_source_list,chunk) $(call get_sub_source_list,amf0)
LOCAL_HEADER_FILES := $(LOCAL_HEADER_FILES) $(call get_sub_source_list,chunk) $(call get_sub_source_list,amf0)
# LOCAL_SOURCE_FILES := $(LOCAL_SOURCE_FILES) $(call get_sub_source_list,chunk) $(call get_sub_source_list,amf0)
# LOCAL_HEADER_FILES := $(LOCAL_HEADER_FILES) $(call get_sub_source_list,chunk) $(call get_sub_source_list,amf0)

$(call add_pkg_config,srt)

Expand Down
16 changes: 16 additions & 0 deletions src/projects/providers/rtmp/rtmp_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,11 @@ namespace pvd

bool result = true;

if(message->header->completed.type_id != RtmpMessageTypeID::Video && message->header->completed.type_id != RtmpMessageTypeID::Audio)
{
logti("%s", StringFromRtmpMessageTypeID(message->header->completed.type_id));
}

switch (message->header->completed.type_id)
{
case RtmpMessageTypeID::Audio:
Expand Down Expand Up @@ -1262,6 +1267,8 @@ namespace pvd
return;
}

logti("AmfDocument \n%s", document.ToString(2).CStr());

// Obtain the message name
ov::String message_name;
auto message_name_property = document.GetProperty(0);
Expand All @@ -1283,6 +1290,7 @@ namespace pvd
auto third_property = document.GetProperty(2);
auto third_type = (third_property != nullptr) ? third_property->GetType() : AmfTypeMarker::Undefined;

logtw("RtmpCommand : %s", message_name.CStr());
switch (RtmpCommandFromString(message_name))
{
case RtmpCommand::SetDataFrame:
Expand All @@ -1291,13 +1299,21 @@ namespace pvd
{
OnAmfMetaData(message->header, third_property);
}
else
{
logtw("SetDataFrame - Data type is not object or ecma array");
}
break;

case RtmpCommand::OnMetaData:
if ((data_name_type == AmfTypeMarker::Object) || (data_name_type == AmfTypeMarker::EcmaArray))
{
OnAmfMetaData(message->header, data_name_property);
}
else
{
logtw("OnMetaData - Data type is not object or ecma array");
}
break;

case RtmpCommand::OnFI:
Expand Down
8 changes: 4 additions & 4 deletions src/projects/providers/rtmp/rtmp_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

#pragma once

#include "amf0/amf_document.h"
#include "modules/rtmp/amf0/amf_document.h"
#include "base/common_types.h"
#include "base/provider/push_provider/stream.h"
#include "chunk/rtmp_chunk_parser.h"
#include "chunk/rtmp_export_chunk.h"
#include "chunk/rtmp_handshake.h"
#include "modules/rtmp/chunk/rtmp_chunk_parser.h"
#include "modules/rtmp/chunk/rtmp_export_chunk.h"
#include "modules/rtmp/chunk/rtmp_handshake.h"
#include "modules/access_control/access_controller.h"

#define MAX_STREAM_MESSAGE_COUNT (500)
Expand Down

0 comments on commit 42a0504

Please sign in to comment.