1/* 2 * Copyright 2019, Ryan Leavengood 3 * Copyright 2009, Axel D��rfler, axeld@pinc-software.de. 4 * Distributed under the terms of the MIT License. 5 */ 6 7 8#include <ServerInterface.h> 9 10#include <set> 11 12#include <Autolock.h> 13#include <Locker.h> 14 15#include <DataExchange.h> 16#include <MediaDebug.h> 17 18#include "PortPool.h" 19 20 21namespace BPrivate { 22namespace media { 23 24 25request_data::request_data() 26{ 27 reply_port = gPortPool->GetPort(); 28} 29 30 31request_data::~request_data() 32{ 33 gPortPool->PutPort(reply_port); 34} 35 36 37status_t 38request_data::SendReply(status_t result, reply_data *reply, 39 size_t replySize) const 40{ 41 reply->result = result; 42 // we cheat and use the (command_data *) version of SendToPort 43 return SendToPort(reply_port, 0, reinterpret_cast<command_data *>(reply), 44 replySize); 45} 46 47 48} // namespace media 49} // namespace BPrivate 50