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

#include "RsServerMediaSession.h"

////////// ServerMediaSession //////////

RsServerMediaSession *RsServerMediaSession ::createNew(UsageEnvironment &t_env, RsSensor &t_sensor,
                                                       char const *t_streamName, char const *t_info,
                                                       char const *t_description, Boolean t_isSSM, char const *t_miscSDPLines)
{
  return new RsServerMediaSession(t_env, t_sensor, t_streamName, t_info, t_description,
                                  t_isSSM, t_miscSDPLines);
}

static char const *const libNameStr = "LIVE555 Streaming Media v";
char const *const libVersionStr = LIVEMEDIA_LIBRARY_VERSION_STRING;

RsServerMediaSession::RsServerMediaSession(UsageEnvironment &t_env,
                                           RsSensor &t_sensor,
                                           char const *t_streamName,
                                           char const *t_info,
                                           char const *t_description,
                                           Boolean t_isSSM, char const *t_miscSDPLines)
    : ServerMediaSession(t_env, t_streamName, t_info, t_description, t_isSSM, t_miscSDPLines), m_rsSensor(t_sensor), m_isActive(false)
{
}

RsServerMediaSession::~RsServerMediaSession()
{
  //TODO:: to check if i need to delete rsSensor
}

void RsServerMediaSession::openRsCamera(std::unordered_map<long long int, rs2::frame_queue> &t_streamProfiles)
{
  m_rsSensor.open(t_streamProfiles);
  m_rsSensor.start(t_streamProfiles);
  m_isActive = true;
}

void RsServerMediaSession::closeRsCamera()
{
  if(m_isActive)
  {
  m_rsSensor.getRsSensor().stop();
  m_rsSensor.getRsSensor().close();
  m_isActive = false;
  }
}

RsSensor &RsServerMediaSession::getRsSensor()
{
  return m_rsSensor;
}
<commit_msg>pause stream on plat after play<commit_after>// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2017 Intel Corporation. All Rights Reserved.

#include "RsServerMediaSession.h"

////////// ServerMediaSession //////////

RsServerMediaSession *RsServerMediaSession ::createNew(UsageEnvironment &t_env, RsSensor &t_sensor,
                                                       char const *t_streamName, char const *t_info,
                                                       char const *t_description, Boolean t_isSSM, char const *t_miscSDPLines)
{
  return new RsServerMediaSession(t_env, t_sensor, t_streamName, t_info, t_description,
                                  t_isSSM, t_miscSDPLines);
}

static char const *const libNameStr = "LIVE555 Streaming Media v";
char const *const libVersionStr = LIVEMEDIA_LIBRARY_VERSION_STRING;

RsServerMediaSession::RsServerMediaSession(UsageEnvironment &t_env,
                                           RsSensor &t_sensor,
                                           char const *t_streamName,
                                           char const *t_info,
                                           char const *t_description,
                                           Boolean t_isSSM, char const *t_miscSDPLines)
    : ServerMediaSession(t_env, t_streamName, t_info, t_description, t_isSSM, t_miscSDPLines), m_rsSensor(t_sensor), m_isActive(false)
{
}

RsServerMediaSession::~RsServerMediaSession()
{
  //TODO:: to check if i need to delete rsSensor
}

void RsServerMediaSession::openRsCamera(std::unordered_map<long long int, rs2::frame_queue> &t_streamProfiles)
{
  if (m_isActive)
  {
    envir()<< "sensor is already open, closing sensor and than open again...\n";
    closeRsCamera();
  }
  m_rsSensor.open(t_streamProfiles);
  m_rsSensor.start(t_streamProfiles);
  m_isActive = true;
}

void RsServerMediaSession::closeRsCamera()
{
  if(m_isActive)
  {
  m_rsSensor.getRsSensor().stop();
  m_rsSensor.getRsSensor().close();
  m_isActive = false;
  }
}

RsSensor &RsServerMediaSession::getRsSensor()
{
  return m_rsSensor;
}

{'fraction_non_alphanumeric': 0.09155972359328726, 'fraction_numerical': 0.004935834155972359, 'mean_word_length': 2.4001677852348995, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3300147', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1173, 'n_words': 259}