diff options
Diffstat (limited to 'xbmc/network/httprequesthandler/HTTPImageTransformationHandler.h')
-rw-r--r-- | xbmc/network/httprequesthandler/HTTPImageTransformationHandler.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/xbmc/network/httprequesthandler/HTTPImageTransformationHandler.h b/xbmc/network/httprequesthandler/HTTPImageTransformationHandler.h new file mode 100644 index 0000000..6d8732d --- /dev/null +++ b/xbmc/network/httprequesthandler/HTTPImageTransformationHandler.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2015-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "XBDateTime.h" +#include "network/httprequesthandler/IHTTPRequestHandler.h" + +#include <stdint.h> +#include <string> + +class CHTTPImageTransformationHandler : public IHTTPRequestHandler +{ +public: + CHTTPImageTransformationHandler(); + ~CHTTPImageTransformationHandler() override; + + IHTTPRequestHandler* Create(const HTTPRequest &request) const override { return new CHTTPImageTransformationHandler(request); } + bool CanHandleRequest(const HTTPRequest &request)const override; + + MHD_RESULT HandleRequest() override; + + bool CanHandleRanges() const override { return true; } + bool CanBeCached() const override { return true; } + bool GetLastModifiedDate(CDateTime &lastModified) const override; + + HttpResponseRanges GetResponseData() const override { return m_responseData; } + + // priority must be higher than the one of CHTTPImageHandler + int GetPriority() const override { return 6; } + +protected: + explicit CHTTPImageTransformationHandler(const HTTPRequest &request); + +private: + std::string m_url; + CDateTime m_lastModified; + + uint8_t* m_buffer; + HttpResponseRanges m_responseData; +}; |