1 /*****************************************************************************
2 * Copyright (C) 2013 x265 project
4 * Authors: Steve Borho <steve@borho.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
20 * This program is also available under a commercial proprietary license.
21 * For more information, contact us at license @ x265.com.
22 *****************************************************************************/
28 // PPA private namespace
30 typedef unsigned short EventID
;
31 typedef unsigned char GroupID
;
39 virtual bool isEventFiltered(EventID eventId
) const = 0;
40 virtual bool configEventById(EventID eventId
, bool filtered
) const = 0;
41 virtual int configGroupById(GroupID groupId
, bool filtered
) const = 0;
42 virtual void configAllEvents(bool filtered
) const = 0;
43 virtual EventID
registerEventByName(const char *pEventName
) = 0;
44 virtual GroupID
registerGroupByName(const char *pGroupName
) = 0;
45 virtual EventID
registerEventInGroup(const char *pEventName
, GroupID groupId
) = 0;
46 virtual void triggerStartEvent(EventID eventId
) = 0;
47 virtual void triggerEndEvent(EventID eventId
) = 0;
48 virtual void triggerTidEvent(EventID eventId
, unsigned int data
) = 0;
49 virtual void triggerDebugEvent(EventID eventId
, unsigned int data0
, unsigned int data1
) = 0;
51 virtual EventID
getEventId(int index
) const = 0;
55 virtual void init(const char **pNames
, int eventCount
) = 0;
58 extern ppa::Base
*ppabase
;
64 ProfileScope(int e
) { if (ppabase
) { id
= ppabase
->getEventId(e
); ppabase
->triggerStartEvent(id
); } else id
= 0; }
65 ~ProfileScope() { if (ppabase
) ppabase
->triggerEndEvent(id
); }