<commit_before>// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2017 Intel Corporation. All Rights Reserved.

#include "RsServerMediaSubsession.h"
#include "RsServerMediaSession.h"
#include "RsSimpleRTPSink.h"

#define CAPACITY 100

RsServerMediaSubsession *RsServerMediaSubsession::createNew(UsageEnvironment &t_env, rs2::video_stream_profile &t_videoStreamProfile)
{
  return new RsServerMediaSubsession(t_env, t_videoStreamProfile /*, queue*/);
}

RsServerMediaSubsession ::RsServerMediaSubsession(UsageEnvironment &env, rs2::video_stream_profile &t_videoStreamProfile )
    : OnDemandServerMediaSubsession(env, false), m_videoStreamProfile(t_videoStreamProfile)
{
  //envir() << "RsServerMediaSubsession constructor" <<this << "\n";
  m_frameQueue = rs2::frame_queue(CAPACITY, true);
}

RsServerMediaSubsession::~RsServerMediaSubsession()
{
  //envir() << "RsServerMediaSubsession destructor" <<this << "\n";
  //TODO:: free the queue
}

rs2::frame_queue &RsServerMediaSubsession::getFrameQueue()
{
  return m_frameQueue;
}

rs2::video_stream_profile RsServerMediaSubsession::getStreamProfile()
{
  return m_videoStreamProfile;
}

FramedSource *RsServerMediaSubsession::createNewStreamSource(unsigned /*t_clientSessionId*/, unsigned &t_estBitrate)
{
  t_estBitrate = 20000;
  return RsDeviceSource::createNew(envir(), m_videoStreamProfile, m_frameQueue);
}

RTPSink *RsServerMediaSubsession ::createNewRTPSink(Groupsock *t_rtpGroupsock,
                                                    unsigned char t_rtpPayloadTypeIfDynamic,
                                                    FramedSource * /*t_inputSource*/)
{
  rs2::device device = ((RsServerMediaSession*)this->fParentSession)->getRsSensor().getDevice();
  return RsSimpleRTPSink::createNew(envir(), t_rtpGroupsock, 96+m_videoStreamProfile.unique_id(), 90000, "X" , "Y" , m_videoStreamProfile, device); //TODO: to rename X and Y
}
<commit_msg>change to stream type<commit_after>// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2017 Intel Corporation. All Rights Reserved.

#include "RsServerMediaSubsession.h"
#include "RsServerMediaSession.h"
#include "RsSimpleRTPSink.h"

#define CAPACITY 100

RsServerMediaSubsession *RsServerMediaSubsession::createNew(UsageEnvironment &t_env, rs2::video_stream_profile &t_videoStreamProfile)
{
  return new RsServerMediaSubsession(t_env, t_videoStreamProfile /*, queue*/);
}

RsServerMediaSubsession ::RsServerMediaSubsession(UsageEnvironment &env, rs2::video_stream_profile &t_videoStreamProfile )
    : OnDemandServerMediaSubsession(env, false), m_videoStreamProfile(t_videoStreamProfile)
{
  //envir() << "RsServerMediaSubsession constructor" <<this << "\n";
  m_frameQueue = rs2::frame_queue(CAPACITY, true);
}

RsServerMediaSubsession::~RsServerMediaSubsession()
{
  //envir() << "RsServerMediaSubsession destructor" <<this << "\n";
  //TODO:: free the queue
}

rs2::frame_queue &RsServerMediaSubsession::getFrameQueue()
{
  return m_frameQueue;
}

rs2::video_stream_profile RsServerMediaSubsession::getStreamProfile()
{
  return m_videoStreamProfile;
}

FramedSource *RsServerMediaSubsession::createNewStreamSource(unsigned /*t_clientSessionId*/, unsigned &t_estBitrate)
{
  t_estBitrate = 20000;
  return RsDeviceSource::createNew(envir(), m_videoStreamProfile, m_frameQueue);
}

RTPSink *RsServerMediaSubsession ::createNewRTPSink(Groupsock *t_rtpGroupsock,
                                                    unsigned char t_rtpPayloadTypeIfDynamic,
                                                    FramedSource * /*t_inputSource*/)
{
  rs2::device device = ((RsServerMediaSession*)this->fParentSession)->getRsSensor().getDevice();
  return RsSimpleRTPSink::createNew(envir(), t_rtpGroupsock, 96+m_videoStreamProfile.stream_type(), 90000, "X" , "Y" , m_videoStreamProfile, device); //TODO: to rename X and Y
}

{'fraction_non_alphanumeric': 0.11242908715832904, 'fraction_numerical': 0.013924703455389376, 'mean_word_length': 5.276699029126213, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6976707', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1179, 'n_words': 219}