Ticket #11922: 0005-Add-BMediaRoster-IsRunning-which-check-if-media-serv.patch

File 0005-Add-BMediaRoster-IsRunning-which-check-if-media-serv.patch, 1.7 KB (added by Barrett, 5 years ago)
  • headers/os/media/MediaRoster.h

    From 3343b69ac7865a75ddba6e62bcecd60232cef18f Mon Sep 17 00:00:00 2001
    From: Dario Casalinuovo <b.vitruvio@gmail.com>
    Date: Thu, 9 Apr 2015 15:39:04 +0200
    Subject: [PATCH 05/13] Add BMediaRoster::IsRunning which check if media
     services are running.
    
    ---
     headers/os/media/MediaRoster.h |  3 +++
     src/kits/media/MediaRoster.cpp | 11 +++++++++++
     2 files changed, 14 insertions(+)
    
    diff --git a/headers/os/media/MediaRoster.h b/headers/os/media/MediaRoster.h
    index 137a03d..fcf3af1 100644
    a b public:  
    4141                // already. It is not thread safe if you call Roster() at the
    4242                // same time.
    4343
     44    // Check if the media services are running.
     45    static bool                 IsRunning();
     46
    4447    // Getting common instances of system nodes:
    4548            status_t            GetVideoInput(media_node* _node);
    4649            status_t            GetAudioInput(media_node* _node);
  • src/kits/media/MediaRoster.cpp

    diff --git a/src/kits/media/MediaRoster.cpp b/src/kits/media/MediaRoster.cpp
    index 7137f6d..1acf332 100644
    a b char __dont_remove_copyright_from_binary[] = "Copyright (c) 2002-2006 Marcus "  
    5252#include <MimeType.h>
    5353#include <OS.h>
    5454#include <ParameterWeb.h>
     55#include <Roster.h>
    5556#include <StopWatch.h>
    5657#include <String.h>
    5758#include <TimeSource.h>
    BMediaRoster::GetInstancesFor(media_addon_id addon, int32 flavor,  
    31763177}
    31773178
    31783179
     3180bool
     3181BMediaRoster::IsRunning()
     3182{
     3183    if (be_roster->IsRunning(B_MEDIA_SERVER_SIGNATURE)
     3184        && be_roster->IsRunning(B_MEDIA_ADDON_SERVER_SIGNATURE))
     3185        return true;
     3186    return false;
     3187}
     3188
     3189
    31793190status_t
    31803191BMediaRoster::SetRealtimeFlags(uint32 enabled)
    31813192{