Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
AirPlayServer.cpp File Reference
#include "AirPlayServer.h"
#include "FileItem.h"
#include "FileItemList.h"
#include "ServiceBroker.h"
#include "URL.h"
#include "application/ApplicationComponents.h"
#include "application/ApplicationPlayer.h"
#include "application/ApplicationVolumeHandling.h"
#include "filesystem/Directory.h"
#include "filesystem/File.h"
#include "input/actions/Action.h"
#include "input/actions/ActionIDs.h"
#include "interfaces/AnnouncementManager.h"
#include "messaging/ApplicationMessenger.h"
#include "network/Network.h"
#include "playlists/PlayListTypes.h"
#include "settings/Settings.h"
#include "settings/SettingsComponent.h"
#include "utils/Digest.h"
#include "utils/StringUtils.h"
#include "utils/Variant.h"
#include "utils/log.h"
#include <mutex>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <inttypes.h>
#include <plist/plist.h>

Macros

#define RECEIVEBUFFER   1024
 
#define AIRPLAY_STATUS_OK   200
 
#define AIRPLAY_STATUS_SWITCHING_PROTOCOLS   101
 
#define AIRPLAY_STATUS_NEED_AUTH   401
 
#define AIRPLAY_STATUS_NOT_FOUND   404
 
#define AIRPLAY_STATUS_METHOD_NOT_ALLOWED   405
 
#define AIRPLAY_STATUS_PRECONDITION_FAILED   412
 
#define AIRPLAY_STATUS_NOT_IMPLEMENTED   501
 
#define AIRPLAY_STATUS_NO_RESPONSE_NEEDED   1000
 
#define EVENT_NONE   -1
 
#define EVENT_PLAYING   0
 
#define EVENT_PAUSED   1
 
#define EVENT_LOADING   2
 
#define EVENT_STOPPED   3
 
#define PLAYBACK_INFO
 
#define PLAYBACK_INFO_NOT_READY
 
#define SERVER_INFO
 
#define EVENT_INFO
 
#define AUTH_REALM   "AirPlay"
 
#define AUTH_REQUIRED   "WWW-Authenticate: Digest realm=\"" AUTH_REALM "\", nonce=\"{:s}\"\r\n"
 

Functions

void ClearPhotoAssetCache ()
 
void handleZeroconfAnnouncement ()
 
std::string calcResponse (const std::string &username, const std::string &password, const std::string &realm, const std::string &method, const std::string &digestUri, const std::string &nonce)
 
std::string getFieldFromString (const std::string &str, const char *field)
 
std::string getStringFromPlist (plist_t node)
 

Variables

const char * eventStrings [] = {"playing", "paused", "loading", "stopped"}
 

Macro Definition Documentation

◆ AIRPLAY_STATUS_METHOD_NOT_ALLOWED

#define AIRPLAY_STATUS_METHOD_NOT_ALLOWED   405

◆ AIRPLAY_STATUS_NEED_AUTH

#define AIRPLAY_STATUS_NEED_AUTH   401

◆ AIRPLAY_STATUS_NO_RESPONSE_NEEDED

#define AIRPLAY_STATUS_NO_RESPONSE_NEEDED   1000

◆ AIRPLAY_STATUS_NOT_FOUND

#define AIRPLAY_STATUS_NOT_FOUND   404

◆ AIRPLAY_STATUS_NOT_IMPLEMENTED

#define AIRPLAY_STATUS_NOT_IMPLEMENTED   501

◆ AIRPLAY_STATUS_OK

#define AIRPLAY_STATUS_OK   200

◆ AIRPLAY_STATUS_PRECONDITION_FAILED

#define AIRPLAY_STATUS_PRECONDITION_FAILED   412

◆ AIRPLAY_STATUS_SWITCHING_PROTOCOLS

#define AIRPLAY_STATUS_SWITCHING_PROTOCOLS   101

◆ AUTH_REALM

#define AUTH_REALM   "AirPlay"

◆ AUTH_REQUIRED

#define AUTH_REQUIRED   "WWW-Authenticate: Digest realm=\"" AUTH_REALM "\", nonce=\"{:s}\"\r\n"

◆ EVENT_INFO

#define EVENT_INFO
Value:
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\r\n" \
"<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" " \
"\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n\r\n" \
"<plist version=\"1.0\">\r\n" \
"<dict>\r\n" \
"<key>category</key>\r\n" \
"<string>video</string>\r\n" \
"<key>sessionID</key>\r\n" \
"<integer>{:d}</integer>\r\n" \
"<key>state</key>\r\n" \
"<string>{:s}</string>\r\n" \
"</dict>\r\n" \
"</plist>\r\n"

◆ EVENT_LOADING

#define EVENT_LOADING   2

◆ EVENT_NONE

#define EVENT_NONE   -1

◆ EVENT_PAUSED

#define EVENT_PAUSED   1

◆ EVENT_PLAYING

#define EVENT_PLAYING   0

◆ EVENT_STOPPED

#define EVENT_STOPPED   3

◆ PLAYBACK_INFO

#define PLAYBACK_INFO

◆ PLAYBACK_INFO_NOT_READY

#define PLAYBACK_INFO_NOT_READY
Value:
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"\
"<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\r\n"\
"<plist version=\"1.0\">\r\n"\
"<dict>\r\n"\
"<key>readyToPlay</key>\r\n"\
"<false/>\r\n"\
"</dict>\r\n"\
"</plist>\r\n"

◆ RECEIVEBUFFER

#define RECEIVEBUFFER   1024

◆ SERVER_INFO

#define SERVER_INFO
Value:
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" \
"<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" " \
"\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\r\n" \
"<plist version=\"1.0\">\r\n" \
"<dict>\r\n" \
"<key>deviceid</key>\r\n" \
"<string>{:s}</string>\r\n" \
"<key>features</key>\r\n" \
"<integer>119</integer>\r\n" \
"<key>model</key>\r\n" \
"<string>Kodi,1</string>\r\n" \
"<key>protovers</key>\r\n" \
"<string>1.0</string>\r\n" \
"<key>srcvers</key>\r\n" \
"<string>" AIRPLAY_SERVER_VERSION_STR "</string>\r\n" \
"</dict>\r\n" \
"</plist>\r\n"
#define AIRPLAY_SERVER_VERSION_STR
Definition AirPlayServer.h:27

Function Documentation

◆ calcResponse()

std::string calcResponse ( const std::string & username,
const std::string & password,
const std::string & realm,
const std::string & method,
const std::string & digestUri,
const std::string & nonce )

◆ ClearPhotoAssetCache()

void ClearPhotoAssetCache ( )

◆ getFieldFromString()

std::string getFieldFromString ( const std::string & str,
const char * field )

◆ getStringFromPlist()

std::string getStringFromPlist ( plist_t node)

◆ handleZeroconfAnnouncement()

void handleZeroconfAnnouncement ( )

Variable Documentation

◆ eventStrings

const char* eventStrings[] = {"playing", "paused", "loading", "stopped"}